-
1. Re: What does this mean? Not binding factory to JNDI, no JND
tinico Mar 12, 2007 1:02 PM (in response to tonylmai)You've probably forgot to specifie the jndi-name in your deployments files for one EJB for example.
-
2. Re: What does this mean? Not binding factory to JNDI, no JND
rhodan76 Mar 13, 2007 4:32 AM (in response to tonylmai)In case you are using EJB3/Hibernate with jboss, this means that you have not explicit specified to bind the EntityManagerFactory (aka SessionFactory) to JNDI. So you cannot look up for the SessionFactory in JNDI.
To register the SessionFactory in JNDI you have to specify it in persistence.xml via following entry:<property name="hibernate.session_factory_name" value="java:hibernate/SessionFactory" />
-
3. Re: What does this mean? Not binding factory to JNDI, no JND
tonylmai Mar 13, 2007 11:35 AM (in response to tonylmai)So if I have not specified a in the <persistence-unit>, would JBoss default it to hibernate? What other options do I have?
Should I specify a explicitly to avoid ambiguity?
Thanks -
4. Re: What does this mean? Not binding factory to JNDI, no JND
rhodan76 Mar 15, 2007 6:19 AM (in response to tonylmai)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. -
5. Re: What does this mean? Not binding factory to JNDI, no JND
tonylmai Mar 15, 2007 11:42 AM (in response to tonylmai)That made sense. Thanks Rhodan76