FAQ
Thanks Dain, your suggestion worked perfect with OpenEJB.

But it doesn't work with JBoss AS 4.2.x. I have this error :
java.lang.ClassCastException: org.hibernate.impl.SessionImpl

Anyway, that's not an Open EJB issue, so I will ask on Hibernate or JBoss
forums.

Thanks.

-Olivier


Dain Sundstrom wrote:
You'll want to do something like this:

@javax.persistence.PersistenceContext(unitName = "t4Seam")
protected javax.persistence.EntityManager emanager;

public HibernateEntityManager getHibernateSession() {
return (HibernateEntityManager) emanager.getDelegate();
}

public void doIt() {
getHibernateSession().doSomething();
}

-dain
--
View this message in context: http://www.nabble.com/PersistenceContext-and-Hibernate-session-tp18404318p18460735.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 10 | next ›
Discussion Overview
groupusers @
categoriesopenejb
postedJul 11, '08 at 1:50p
activeJul 16, '08 at 3:28a
posts10
users4
websiteopenejb.apache.org
irc#openejb

People

Translate

site design / logo © 2021 Grokbase