In EJB3 you need only in rare circumstances use of a SessionFactory. Mostly you 
would inject a EntityManager(-Factory) directly via annotations in your Beans.

So in most of your applications you don't need a SessionFactory and there there 
would be no need to register the name of the SF in JNDI.

There are some application-points under EJB3, where annotation-based injection 
of EntityManager(-Factory) isn't possible. In such a case you can lookup for 
the SessionFactory in JNDI.

An Exammple for the need of a SessionFactory are the Hibernate EventListeners. 
Inside such a Listener , if you possibly want to make a db-query, 
ejb3-injection of EntityManager will not work there, because Hibernate 
Listeners are no EJB3-components. But you can lookup for the (registered) SF 
and use this.

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028297
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to