org.springframework.orm.jpa.vendor
Class OpenJpaDialect.OpenJpaConnectionHandle

java.lang.Object
  extended by 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()

Field Summary
private  OpenJPAEntityManager entityManager
           
 
Constructor Summary
OpenJpaDialect.OpenJpaConnectionHandle(OpenJPAEntityManager entityManager)
           
 
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
 

Field Detail

entityManager

private final OpenJPAEntityManager entityManager
Constructor Detail

OpenJpaDialect.OpenJpaConnectionHandle

public OpenJpaDialect.OpenJpaConnectionHandle(OpenJPAEntityManager entityManager)
Method Detail

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