openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Wolf (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2393) Can only get java.sql.Connection from EMF's DataSource in container-managed env.
Date Thu, 06 Jun 2013 21:28:19 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-2393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13677529#comment-13677529
] 

Chris Wolf commented on OPENJPA-2393:
-------------------------------------

The technique of getting a java.sql.Connection from an EntityManager, as described here:
http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/manual.html#ref_guide_dbsetup_conn_jpa
..works, however, you have to keep the EntityManagerFactory instance in-scope and open for
the duration of using the Connection, whereas  with using the EntityManagerFactory's DataSource,
as described in the description of this ticket - you can close the EMF right after getting
the connection.
                
> Can only get java.sql.Connection from EMF's DataSource in container-managed env.
> --------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2393
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2393
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.2.1
>         Environment: Windows-7/64bit, Oracle/Sun JRE-1.6.x, JBoss-6.1.0 and standalone
app (JSE)
>            Reporter: Chris Wolf
>            Priority: Minor
>              Labels: OpenJPAConfiguration
>
> The documentation describes how to obtain a plain java.sql.Connection from the EntityManagerFactory,
but it only works in a managed container environment (JEE).  The page I'm referring to is
here:
> http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/manual.html#ref_guide_dbsetup_conn_from_factory_jpa

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message