Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E19FA9286 for ; Thu, 2 Feb 2012 16:57:14 +0000 (UTC) Received: (qmail 11574 invoked by uid 500); 2 Feb 2012 16:57:14 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 11549 invoked by uid 500); 2 Feb 2012 16:57:14 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 11541 invoked by uid 99); 2 Feb 2012 16:57:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Feb 2012 16:57:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Feb 2012 16:57:12 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 5ADE81889DA for ; Thu, 2 Feb 2012 16:56:51 +0000 (UTC) Date: Thu, 2 Feb 2012 16:56:51 +0000 (UTC) From: "Albert Lee (Closed) (JIRA)" To: dev@openjpa.apache.org Message-ID: <849318489.3418.1328201811373.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Closed] (OPENJPA-1803) Unwrap EntityManager to Connection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Albert Lee closed OPENJPA-1803. ------------------------------- Close issue in preparation for 2.2.0 release. > Unwrap EntityManager to Connection > ---------------------------------- > > Key: OPENJPA-1803 > URL: https://issues.apache.org/jira/browse/OPENJPA-1803 > Project: OpenJPA > Issue Type: Improvement > Components: competitive, jpa > Affects Versions: 2.0.1 > Reporter: Harald Wellmann > Assignee: Rick Curtis > Fix For: 2.2.0 > > Attachments: OPENJPA-1803.patch > > > 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. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira