[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Getting a session from entityManager

andydale do-not-reply at jboss.com
Mon Aug 6 09:08:37 EDT 2007


Hi,

Does the EntityManager work normally, for example does em.persist() work ?  

I have had a problem berfore with em.getDelegate() returning an EntityManagerImpl which could not be cast to a session.

In the end i had to call 

Session sess = (Session)((EntityManagerImpl)em.getDelegate()).getDelegate()

or

Session sess = (Session)((EntityManagerImpl)em.getDelegate()).getSession()

Cheers,

Andy

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

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



More information about the jboss-user mailing list