Joemon Anthony

Greenhorn
+ Follow
since May 22, 2011
Merit badge: grant badges
Biography
Am working as a Java Developer in one of the best companies in world.
For More
Kochi
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Joemon Anthony

Thanks Paul.

It worked with your solution.
I want to add a Map in a ThreadLocal.

I tried like this:


And in the main class :

But after executing this I am getting null pointer exception.

Could any please help.
My application works on http request. I wanted to change that to https.
I am using Spring 3 framework and Tomcat 7 Server.
I don't know from where to start or how to do this.

Please suggest.

Thanks.
11 years ago
Deepak, could you please elaborate it. If possible can you share an example.

Rob Micah wrote:If I used a synchronize block inside my servlet on a static method could that accomplish the same thing?



Never do this. By doing this you will end up by locking the whole class. So other requests will have to wait, for this request(which has acquired lock) to complete. Eventually will become a big bottleneck. So avoid this.
Add servletconfig.jar in your class-path.
13 years ago
Please go through this url click here
13 years ago
Why do you want Dynamic JNDI? What is your purpose?
With JPA, what ever chances you do, that happens in the persistence context area. When the service(the method which you have called) ends, at that time all the contents of the persistence context area is flushed into the database.

1. For service updateForTestJPQL: - Whatever things you are doing is part of JPQL(JPA), and the data from persistence context will be flushed only at the end of service call. That is the reason why all the records in the database are having the same value "gialli".

2. For service updateForTestNative: - In this service you are using native Query, so the updation in the database will occur at the time itself, when you call the executeUpdate. and finally when the service ends the data in the persistence context gets flushed. That means, with native query update, all the records will be updated with value "gialli", but when finally the service ends the persistence context data will be flushed and entered into database, thats why you are getting one record with value "bianchi"

Carlo Moore :
There are major differences between EJB 2.1 and EJB 3. You will need to modify a lot of your code in order to use EJB 3. EJB 3 is a lot simpler and straight foreward to use than EJB 2.1 though.



This is absolutely right.

It takes a lot of effort to convert EJB2.1 to EJB 3. When I told you(Mary Koh) to use EJB3, I was not aware that you were using EJB 2.1.