This content has been marked as final.
Show 1 reply
-
1. Re: Howto Get SessionFactory from JNDI
gjeudy Aug 13, 2008 3:33 PM (in response to sbyrne.sb.ezftz.com)try java:/myDatabase
Source code in
org.jboss.seam.persistence.ManagedPersistenceContext
seems to hint at that.@Create public void create(Component component) { this.componentName = component.getName(); if (persistenceUnitJndiName==null) { persistenceUnitJndiName = "java:/" + componentName; } PersistenceContexts.instance().touch(componentName); }
If for some reasons this fails you can use hibernate feature to publish sessionfactory in global jndi namespace by adding the following to your persistence.xml.
<property name="hibernate.session_factory_name" value="java:/mySessionFactory" />