| How do you retrieve Hibernate's Session from an EJB 3.0 ? |
| Written by Mark S. | |||||
|
Reading the EJB 3.0 documentation it should be simply obtained by casting the EntityManager instance. org.hibernate.Session session = (org.hibernate.Session)entityManager; However, there seems to be a problem with JBoss AS 5.0, because a ClassCastException is issued. You can use the the getDelegate() method of the entity manager to avoid this problem: org.hibernate.Session session = (org.hibernate.Session)entityManager.getDelegate();
JBoss.org Search
Custom Search
Only registered users can write comments!
Powered by !JoomlaComment 3.26
3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved." |


