Are you sure you are interested in having the EntityManager created the first 
time the factory (singleton) is created? And then using that EM instance? I 
don't think EM is thread safe.

I had the same decision to take some time ago, and I preferred to pass EM as 
parameter to DAO class when calling static method. Doing so, I'm sure to pass 
the EM private to current thread.

More: I create a bunch of EM in my interceptors and I store them in threadlocal 
variables so to get visibility both in other interceptors and bean.
Every piece of code gets what it needs and passes it to DAO.
It's useful to put jboss classes on debug level in log4j conf. Doing that you 
could have a look at EM lifecycle.

Tell me what you think.
bye
F


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3956252#3956252

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3956252

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to