Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.2.0
    • Component/s: competitive, jpa
    • Labels:
      None

      Description

      This is currently the recommended way to access the javax.sql.Connection underlying an EntityManager:

      OpenJPAEntityManager oem = OpenJPAPersistence.cast(em);
      Connection con = (Connection) oem.getConnection();

      It would be more convenient to simply write

      Connection con = em.unwrap(Connection.class);

      That way, the client needing to access the Connection only depends on the javax.persistence API and not on org.apache.openjpa.*.

      I believe the JPA 2.0 spec neither mandates nor forbids this functionality. It is supported by Eclipselink 2.x.

        Attachments

        1. OPENJPA-1803.patch
          2 kB
          Sebastian Laskawiec

          Activity

            People

            • Assignee:
              curtisr7 Rick Curtis
              Reporter:
              hwellmann Harald Wellmann
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: