Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-1607 Update tutorials
  3. EJBTHREE-1706

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

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Done
    • Major
    • None
    • None
    • docs
    • None

    Description

      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).

      Attachments

        Activity

          People

            jaikiran Jaikiran Pai (Inactive)
            jaikiran Jaikiran Pai (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: