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

        Albert Lee made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Rick Curtis made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Rick Curtis made changes -
        Fix Version/s 2.2.0 [ 12315910 ]
        Rick Curtis made changes -
        Assignee Rick Curtis [ curtisr7 ]
        Sebastian Laskawiec made changes -
        Attachment OPENJPA-1803.patch [ 12483291 ]
        Donald Woods made changes -
        Field Original Value New Value
        Component/s competitive [ 12313757 ]
        Harald Wellmann created 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