Package org.hibernate.jdbc
Class JDBCContext
java.lang.Object
org.hibernate.jdbc.JDBCContext
- All Implemented Interfaces:
Serializable,ConnectionManager.Callback
Acts as the mediary between "entity-mode related" sessions in terms of
their interaction with the JDBC data store.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionJDBCContext(JDBCContext.Context owner, Connection connection, Interceptor interceptor) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterNontransactionalQuery(boolean success) Called after executing a query outside the scope of a Hibernate or JTA transactionvoidWe cannot rely upon this method being called! It is only called if we are using Hibernate Transaction API.voidafterTransactionCompletion(boolean success, Transaction tx) voidvoidvoidvoidstatic JDBCContextdeserialize(ObjectInputStream ois, JDBCContext.Context context, Interceptor interceptor) Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.getJtaSynchronizationCallbackCoordinator(Transaction jtaTransaction) booleanbooleanbooleanvoidCustom serialization routine used during serialization of a Session/PersistenceContext for increased performance.
-
Constructor Details
-
JDBCContext
-
-
Method Details
-
getJtaSynchronizationCallbackCoordinator
-
getJtaSynchronizationCallbackCoordinator
-
cleanUpJtaSynchronizationCallbackCoordinator
public void cleanUpJtaSynchronizationCallbackCoordinator() -
connectionOpened
public void connectionOpened()- Specified by:
connectionOpenedin interfaceConnectionManager.Callback
-
connectionCleanedUp
public void connectionCleanedUp()- Specified by:
connectionCleanedUpin interfaceConnectionManager.Callback
-
getFactory
-
getConnectionManager
-
borrowConnection
-
connection
- Throws:
HibernateException
-
registerCallbackIfNecessary
public boolean registerCallbackIfNecessary() -
registerSynchronizationIfPossible
public boolean registerSynchronizationIfPossible() -
isTransactionInProgress
public boolean isTransactionInProgress()- Specified by:
isTransactionInProgressin interfaceConnectionManager.Callback
-
getTransaction
- Throws:
HibernateException
-
beforeTransactionCompletion
-
afterTransactionBegin
We cannot rely upon this method being called! It is only called if we are using Hibernate Transaction API. -
afterTransactionCompletion
-
afterNontransactionalQuery
public void afterNontransactionalQuery(boolean success) Called after executing a query outside the scope of a Hibernate or JTA transaction -
serialize
Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.- Parameters:
oos- The stream to which we should write the serial data.- Throws:
IOException
-
deserialize
public static JDBCContext deserialize(ObjectInputStream ois, JDBCContext.Context context, Interceptor interceptor) throws IOException Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.- Parameters:
ois- The stream from which to read the entry.- Throws:
IOException
-