org.springframework.orm.jpa.vendor
Class OpenJpaDialect.OpenJpaConnectionHandle
java.lang.Object
org.springframework.orm.jpa.vendor.OpenJpaDialect.OpenJpaConnectionHandle
- All Implemented Interfaces:
- ConnectionHandle
- Enclosing class:
- OpenJpaDialect
private static class OpenJpaDialect.OpenJpaConnectionHandle
- extends java.lang.Object
- implements ConnectionHandle
ConnectionHandle implementation that fetches a new OpenJPA-provided Connection
for every getConnection
call and closes the Connection on
releaseConnection
. This is necessary because OpenJPA requires the
fetched Connection to be closed before continuing EntityManager work.
- See Also:
org.apache.openjpa.persistence.OpenJPAEntityManager#getConnection()
Method Summary |
java.sql.Connection |
getConnection()
Fetch the JDBC Connection that this handle refers to. |
void |
releaseConnection(java.sql.Connection con)
Release the JDBC Connection that this handle refers to. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
entityManager
private final OpenJPAEntityManager entityManager
OpenJpaDialect.OpenJpaConnectionHandle
public OpenJpaDialect.OpenJpaConnectionHandle(OpenJPAEntityManager entityManager)
getConnection
public java.sql.Connection getConnection()
- Description copied from interface:
ConnectionHandle
- Fetch the JDBC Connection that this handle refers to.
- Specified by:
getConnection
in interface ConnectionHandle
releaseConnection
public void releaseConnection(java.sql.Connection con)
- Description copied from interface:
ConnectionHandle
- Release the JDBC Connection that this handle refers to.
- Specified by:
releaseConnection
in interface ConnectionHandle
- Parameters:
con
- the JDBC Connection to release