Class ConnectionFactoryImpl.ManagedConnectionImpl

  • All Implemented Interfaces:
    org.datanucleus.store.connection.ManagedConnection
    Enclosing class:
    ConnectionFactoryImpl

    class ConnectionFactoryImpl.ManagedConnectionImpl
    extends org.datanucleus.store.connection.AbstractManagedConnection
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) org.datanucleus.ExecutionContext ec  
      (package private) int isolation  
      (package private) boolean needsCommitting  
      private java.util.Map<java.lang.String,​java.sql.Savepoint> savepoints  
      (package private) javax.transaction.xa.XAResource xaRes  
      • Fields inherited from class org.datanucleus.store.connection.AbstractManagedConnection

        closeOnRelease, commitOnRelease, conn, listeners, locked, useCount
    • Constructor Summary

      Constructors 
      Constructor Description
      ManagedConnectionImpl​(org.datanucleus.ExecutionContext ec, java.util.Map options)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the connection
      boolean closeAfterTransactionEnd()  
      java.lang.Object getConnection()
      Create a connection to the resource
      private java.sql.Connection getSqlConnection()
      Convenience accessor for the java.sql.Connection in use (if any).
      javax.transaction.xa.XAResource getXAResource()
      Obtain an XAResource which can be enlisted in a transaction
      void release()
      Release this connection.
      void releaseSavepoint​(java.lang.String name)  
      void rollbackToSavepoint​(java.lang.String name)  
      void setSavepoint​(java.lang.String name)  
      • Methods inherited from class org.datanucleus.store.connection.AbstractManagedConnection

        addListener, closeOnRelease, commitOnRelease, incrementUseCount, isLocked, lock, removeListener, setCloseOnRelease, setCommitOnRelease, toString, transactionFlushed, transactionPreClose, unlock
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • ec

        org.datanucleus.ExecutionContext ec
      • xaRes

        javax.transaction.xa.XAResource xaRes
      • isolation

        int isolation
      • needsCommitting

        boolean needsCommitting
      • savepoints

        private java.util.Map<java.lang.String,​java.sql.Savepoint> savepoints
    • Constructor Detail

      • ManagedConnectionImpl

        ManagedConnectionImpl​(org.datanucleus.ExecutionContext ec,
                              java.util.Map options)
    • Method Detail

      • release

        public void release()
        Release this connection. Releasing this connection will allow this managed connection to be used one or more times inside the same transaction. If this managed connection is managed by a transaction manager, release is a no-op, otherwise the physical connection is closed
        Specified by:
        release in interface org.datanucleus.store.connection.ManagedConnection
        Overrides:
        release in class org.datanucleus.store.connection.AbstractManagedConnection
      • getXAResource

        public javax.transaction.xa.XAResource getXAResource()
        Obtain an XAResource which can be enlisted in a transaction
        Specified by:
        getXAResource in interface org.datanucleus.store.connection.ManagedConnection
        Overrides:
        getXAResource in class org.datanucleus.store.connection.AbstractManagedConnection
      • getConnection

        public java.lang.Object getConnection()
        Create a connection to the resource
      • close

        public void close()
        Close the connection
        Specified by:
        close in interface org.datanucleus.store.connection.ManagedConnection
        Overrides:
        close in class org.datanucleus.store.connection.AbstractManagedConnection
      • getSqlConnection

        private java.sql.Connection getSqlConnection()
        Convenience accessor for the java.sql.Connection in use (if any).
        Returns:
        SQL Connection
      • setSavepoint

        public void setSavepoint​(java.lang.String name)
        Specified by:
        setSavepoint in interface org.datanucleus.store.connection.ManagedConnection
        Overrides:
        setSavepoint in class org.datanucleus.store.connection.AbstractManagedConnection
      • releaseSavepoint

        public void releaseSavepoint​(java.lang.String name)
        Specified by:
        releaseSavepoint in interface org.datanucleus.store.connection.ManagedConnection
        Overrides:
        releaseSavepoint in class org.datanucleus.store.connection.AbstractManagedConnection
      • rollbackToSavepoint

        public void rollbackToSavepoint​(java.lang.String name)
        Specified by:
        rollbackToSavepoint in interface org.datanucleus.store.connection.ManagedConnection
        Overrides:
        rollbackToSavepoint in class org.datanucleus.store.connection.AbstractManagedConnection
      • closeAfterTransactionEnd

        public boolean closeAfterTransactionEnd()
        Specified by:
        closeAfterTransactionEnd in interface org.datanucleus.store.connection.ManagedConnection
        Overrides:
        closeAfterTransactionEnd in class org.datanucleus.store.connection.AbstractManagedConnection