Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major 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.

      1. OPENJPA-1803.patch
        2 kB
        Sebastian Laskawiec

        Activity

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development