tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AndyG <andy.gumbre...@orprovision.com>
Subject Re: Could not locate SessionFactory in JNDI
Date Mon, 28 Nov 2011 07:56:55 GMT
Try this, if you really need to get to the hibernate session (you can then
get the factory from the session):

private EntityManager em;

@PersistenceContext(unitName = "your_context_name", type =
PersistenceContextType.TRANSACTION)
public final void setEntityManager(final EntityManager em) {
	this.em = em;
}

....

final Session s = ((org.hibernate.ejb.EntityManagerImpl)
this.em.getDelegate()).getSession();


--
View this message in context: http://openejb.979440.n4.nabble.com/Could-not-locate-SessionFactory-in-JNDI-tp4113852p4114450.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message