Top Description Inners Fields Constructors Methods
org.hibernate.jdbc

public Class JDBCContext

extends Object
implements Serializable, Callback
Class Inheritance
All Implemented Interfaces
org.hibernate.jdbc.ConnectionManager.Callback, java.io.Serializable
Imports
java.io.Serializable, .ObjectOutputStream, .IOException, .ObjectInputStream, java.sql.Connection, .SQLException, javax.transaction.TransactionManager, org.slf4j.Logger, .LoggerFactory, org.hibernate.ConnectionReleaseMode, .HibernateException, .Interceptor, .SessionException, .Transaction, .TransactionException, org.hibernate.transaction.synchronization.CallbackCoordinator, .HibernateSynchronizationImpl, org.hibernate.util.JTAHelper, org.hibernate.engine.SessionFactoryImplementor, org.hibernate.exception.JDBCExceptionHelper, org.hibernate.transaction.CacheSynchronization, .TransactionFactory

Acts as the mediary between "entity-mode related" sessions in terms of their interaction with the JDBC data store.
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Field Summary

Modifier and TypeField and Description
private ConnectionManager
private transient Transaction
private transient boolean
private CallbackCoordinator
private static final Logger
private JDBCContext.Context

Constructor Summary

AccessConstructor and Description
public
JDBCContext(JDBCContext.Context owner, Connection connection, Interceptor interceptor)

private
JDBCContext()

Private constructor used exclusively for custom serialization...

Method Summary

Modifier and TypeMethod and Description
public void
afterNontransactionalQuery(boolean success)

Called after executing a query outside the scope of a Hibernate or JTA transaction

public void
afterTransactionBegin(Transaction tx)

We cannot rely upon this method being called!

public void
public void
public Connection
public void
public Connection
public void
public void
public static JDBCContext
deserialize(ObjectInputStream
The stream from which to read the entry.
ois
,
JDBCContext.Context context, Interceptor interceptor)

Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.

public ConnectionManager
public SessionFactoryImplementor
public CallbackCoordinator
public CallbackCoordinator
public Transaction
public boolean
private void
public boolean
public boolean
public void
serialize(ObjectOutputStream
The stream to which we should write the serial data.
oos
)

Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectionManagerback to summary
private ConnectionManager connectionManager
hibernateTransactionback to summary
private transient Transaction hibernateTransaction
isTransactionCallbackRegisteredback to summary
private transient boolean isTransactionCallbackRegistered
jtaSynchronizationCallbackCoordinatorback to summary
private CallbackCoordinator jtaSynchronizationCallbackCoordinator
logback to summary
private static final Logger log
ownerback to summary
private JDBCContext.Context owner

Constructor Detail

JDBCContextback to summary
public JDBCContext(JDBCContext.Context owner, Connection connection, Interceptor interceptor)
JDBCContextback to summary
private JDBCContext()

Private constructor used exclusively for custom serialization...

Method Detail

afterNontransactionalQueryback to summary
public void afterNontransactionalQuery(boolean success)

Called after executing a query outside the scope of a Hibernate or JTA transaction

afterTransactionBeginback to summary
public void afterTransactionBegin(Transaction tx)

We cannot rely upon this method being called! It is only called if we are using Hibernate Transaction API.

afterTransactionCompletionback to summary
public void afterTransactionCompletion(boolean success, Transaction tx)
beforeTransactionCompletionback to summary
public void beforeTransactionCompletion(Transaction tx)
borrowConnectionback to summary
public Connection borrowConnection()
cleanUpJtaSynchronizationCallbackCoordinatorback to summary
public void cleanUpJtaSynchronizationCallbackCoordinator()
connectionback to summary
public Connection connection() throws HibernateException
connectionCleanedUpback to summary
public void connectionCleanedUp()

Implements org.hibernate.jdbc.ConnectionManager.Callback.connectionCleanedUp.

connectionOpenedback to summary
public void connectionOpened()

Implements org.hibernate.jdbc.ConnectionManager.Callback.connectionOpened.

deserializeback to summary
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:ObjectInputStream

The stream from which to read the entry.

getConnectionManagerback to summary
public ConnectionManager getConnectionManager()
getFactoryback to summary
public SessionFactoryImplementor getFactory()
getJtaSynchronizationCallbackCoordinatorback to summary
public CallbackCoordinator getJtaSynchronizationCallbackCoordinator()
getJtaSynchronizationCallbackCoordinatorback to summary
public CallbackCoordinator getJtaSynchronizationCallbackCoordinator(Transaction jtaTransaction)
getTransactionback to summary
public Transaction getTransaction() throws HibernateException
isTransactionInProgressback to summary
public boolean isTransactionInProgress()

Implements org.hibernate.jdbc.ConnectionManager.Callback.isTransactionInProgress.

readObjectback to summary
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException
registerCallbackIfNecessaryback to summary
public boolean registerCallbackIfNecessary()
registerSynchronizationIfPossibleback to summary
public boolean registerSynchronizationIfPossible()
serializeback to summary
public void serialize(ObjectOutputStream oos) throws IOException

Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.

Parameters
oos:ObjectOutputStream

The stream to which we should write the serial data.

writeObjectback to summary
private void writeObject(ObjectOutputStream oos) throws IOException
org.hibernate.jdbc back to summary

public Interface JDBCContext.Context

extends Context
Known Direct Implementers
org.hibernate.impl.SessionImpl, org.hibernate.impl.StatelessSessionImpl

Method Summary

Modifier and TypeMethod and Description
public void
afterTransactionBegin(Transaction tx)

We cannot rely upon this method being called!

public void
public void
public ConnectionReleaseMode
public boolean
Inherited from org.hibernate.transaction.TransactionFactory.Context:
getFactoryisClosedisFlushBeforeCompletionEnabledisFlushModeNevermanagedClosemanagedFlushshouldAutoClose

Method Detail

afterTransactionBeginback to summary
public void afterTransactionBegin(Transaction tx)

We cannot rely upon this method being called! It is only called if we are using Hibernate Transaction API.

afterTransactionCompletionback to summary
public void afterTransactionCompletion(boolean success, Transaction tx)
beforeTransactionCompletionback to summary
public void beforeTransactionCompletion(Transaction tx)
getConnectionReleaseModeback to summary
public ConnectionReleaseMode getConnectionReleaseMode()
isAutoCloseSessionEnabledback to summary
public boolean isAutoCloseSessionEnabled()