[jboss-jira] [JBoss JIRA] Created: (EJBTHREE-1706) Add a new tutorial to demonstrate the access of org.hibernate.Session from Entitymanager

jaikiran pai (JIRA) jira-events at lists.jboss.org
Fri Jan 30 03:08:54 EST 2009


Add a new tutorial to demonstrate the access of org.hibernate.Session from Entitymanager
----------------------------------------------------------------------------------------

                 Key: EJBTHREE-1706
                 URL: https://jira.jboss.org/jira/browse/EJBTHREE-1706
             Project: EJB 3.0
          Issue Type: Sub-task
          Components: Documentation
         Environment: JBossAS5.0 GA
            Reporter: jaikiran pai
            Assignee: jaikiran pai


The reference documentation has a piece of code which shows how org.hibernate.Session can be accessed from a EntityManager:

 You can get access to the current underlying Hibernate Session by typecasting your reference to EntityManager.

       @PersistenceContext EntityManager entityManager;
       public void someMethod();
       {
         org.jboss.ejb3.entity.HibernateSession hs = (HibernateSession)entityManager;
         org.hibernate.Session session = hs.getHibernateSession();
       }
      

This doesn't work in AS5. To get it working in AS5, we need to use entityManager.getDelegate() method. See the forum thread for details.

The intent of this JIRA is to create a new tutorial with these details (instead of having this in the reference doc which cannot be tracked for any code/API breakage).


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list