Salil Vverma

Ranch Hand
+ Follow
since Sep 06, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Salil Vverma

if you are looking for a client side solution for searching and pagination. You can use JQuery data table. The sample example can be accessed from following link - https://datatables.net/examples/api/regex.html

For bringing only the required contents to html, you can use x class of JSTL or XSLT with JAXP at server side, to identify only the required contents.
8 years ago
JSP
How are you trying to run this program? Using any IDE or command line?

If from command line, what commands are you using and from which folder are you running the command?
8 years ago

Disadvantage: I will lose Object oriented world and every place I have to put the condition as below.



If you use table per class hierarchy, the class structure would have three classes ie Account, SavingAccount CurrentAccount. Most of the persistence related operations would be performed from the object/class of SavingAccount & CurrentAccount. In this way the object oriented nature of your java program would not get impacted.

If most of the attributes are same, we should prefer using table per class hierarchy & if many attributes are different table per subclass or table per concrete class could be used.
Jmx notification should fullfill your need. It would let the client know (via rmi) when one server goes down.
10 years ago
Hey Jyoti,

org.hibernate.annotations.Entity has been deprecated and was planned to be removed in Hibernate 4.1. The link of same is as attached below
http://docs.jboss.org/hibernate/core/4.0/javadocs/org/hibernate/annotations/Entity.html

Hey amol,

Rather than asking for complete solution. Can you please suggest what have you tried and where exactly are you stuck ?
This will help us helping you in a better way.


Hey H,

How are you creating the corresponding table, via sql or letting hibernate generate the table?
If you are using sql to generate the corresponding table, can you please paste the query used for corresponding table creation ?
Hey Jyoti,

I have a solution, which would fulfill your need partially. The solution goes as following -
1- Make your Junit test case with Junit 4.0, this will help you in eliminating test prefix from all of your junit test cases
2- Name all your test cases as the report name (by eliminating the special characters)

After this, test case execution report would have almost report name instead of unsimilar test case name.

11 years ago
If I see the database perspective, you will probably want to create normalized tables.

In this scenario, you can create two tables one employee and another person.To map it with hibernate, you can use table per class approach of inheritance mapping and have two Dao ,making sure that both of the entities could be handled independently as well.
Hey Yogesh,

Seeing your code on very high level, It looks like you are trying to use spring and hibernate both together but not the way we use it via spring-orm.

You have created entity i.e. UserEntity and hibernate configuration file hibernate.cfg.xml, But not mentioned in hibernate.cfg.xml file that UserEntity entity mapping is for the session factory that you are creating.
This declaration can be done using mapping tag which is a child of session-factory tag in hibernate.cfg.xml. The sample use is as following -



Try it and let us know if you still face the same problem.

Volatile is not needed, since the values are only used in the synchronized block/method. Volatile is needed to make sure multiple threads see the latest state of the variable. The synchronized method provides memory barriers that ensure the values are published to threads before they are read (as long as they are also read in a synchronized block or method). Volatile is redundant, probably a little inefficient, and a bit misleading.



Hey Steve,

Ah.. you are right.. Synchronized method's memory barrier would ensure the value publishing so volatile is not needed. I had missed the memory barrier concept while suggesting the solution.
Thanks for pointing it out.
Hey Jayesh,

As you are processing too many files, you might want to make sure that at a time only certain number of files (probably 2-3) are loaded.

If you want to get optimum performance in this file loading & processing activity. I will suggest to load and process file using different threads. This way, in the mean time, when one thread would be processing the file other thread would be loading the other file. As soon as processing of one file is complete other file would have got loaded and available for processing.

To make sure that at a time only max certain number of files (probably 2-3) are loaded and loading and processing thread does not conflict ,you can use blocking queue.

11 years ago
Hey,

As while sending the object to business or presentation layer, we get the object detached from session and persistence context associated is destroyed.
I think, in hibernate, we should be able to achieve the updation of only modified column in following way -

By setting select-before-update option along with dynamic update to true. In this scenario, Hibernate will at first fire a select query to retrieve the record and check if data in bean has been updated ( by select-before-update) and if data has been updated then update query of selected column will be fired (by dynamic update).


Personally I would not recommend this approach.As these will add additional overhead by firing addition queries to check whether the state of object has changed. As you are working on a web-application, I would recommend using javascript and pointing out the changed records as soon as change happens in presentation layer and persisting only the changed records. This approach would provide you optimum performance.

Regards
Salil Verma
Default scope is singleton to make sure that minimum number of objects are created during bean factory instantiation.
If single bean instance does not fit into specific scenario, user can choose to set beans scope as prototype.
11 years ago
Hey Vivek,

From concurrency perspective. The code would be all right after adding volatile in the static fields mentioned your previous post.