Interface JdbcSessionOwner
- All Known Subinterfaces:
EventSource, SessionImplementor, SharedSessionContractImplementor, StatelessSessionImplementor
- All Known Implementing Classes:
SessionDelegatorBaseImpl, SharedSessionDelegatorBaseImpl
public interface JdbcSessionOwner
Contract for something that controls a
JdbcSessionContext.
The term JDBC session is taken from the SQL specification which calls a connection and its associated transaction context a "session".
- API Note:
- The name comes from the design idea of a
JdbcSessionwhich encapsulates this information, which we will hopefully get back to later.
-
Method Summary
Modifier and TypeMethodDescriptionvoidafterObtainConnection(Connection connection) Called after a managed JDBC connection is obtained.voidAn after-begin callback from the coordinator to its owner.voidafterTransactionCompletion(boolean successful, boolean delayed) An after-completion callback to the owner.voidbeforeReleaseConnection(Connection connection) Called right before a managed JDBC connection is released.voidA before-completion callback to the owner.voiddefault EventManagerDeprecated, for removal: This API element is subject to removal in a future version.Obtain a reference to theEventMonitor.Get the session-level JDBC batch size.default SqlExceptionHelperObtain theTransactionCoordinator.voidCallback indicating recognition of entering into a transactional context whether that is explicitly via the HibernateTransactionAPI or via registration of Hibernate's JTA Synchronization impl with a JTA Transaction
-
Method Details
-
getJdbcSessionContext
JdbcSessionContext getJdbcSessionContext() -
getJdbcConnectionAccess
JdbcConnectionAccess getJdbcConnectionAccess() -
getTransactionCoordinator
TransactionCoordinator getTransactionCoordinator()Obtain theTransactionCoordinator.- Returns:
- The
TransactionCoordinator
-
startTransactionBoundary
void startTransactionBoundary()Callback indicating recognition of entering into a transactional context whether that is explicitly via the HibernateTransactionAPI or via registration of Hibernate's JTA Synchronization impl with a JTA Transaction -
afterTransactionBegin
void afterTransactionBegin()An after-begin callback from the coordinator to its owner. -
beforeTransactionCompletion
void beforeTransactionCompletion()A before-completion callback to the owner. -
afterTransactionCompletion
void afterTransactionCompletion(boolean successful, boolean delayed) An after-completion callback to the owner.- Parameters:
successful- Was the transaction successful?delayed- Is this a delayed after transaction completion call (aka after a timeout)?
-
flushBeforeTransactionCompletion
void flushBeforeTransactionCompletion() -
getJdbcBatchSize
Integer getJdbcBatchSize()Get the session-level JDBC batch size.- Returns:
- session-level JDBC batch size
- Since:
- 5.2
-
getSqlExceptionHelper
-
afterObtainConnection
Called after a managed JDBC connection is obtained.Sets the schema to the schema belonging to the current tenant if:
- "hibernate.multi_tenant.schema_mapper" is enabled, and
- this session has an active tenant id.
- Parameters:
connection- A JDBC connection which was just acquired- Throws:
SQLException- Since:
- 7.1
-
beforeReleaseConnection
Called right before a managed JDBC connection is released.Unset the schema which was set by
afterObtainConnection(Connection), if any. .- Parameters:
connection- The JDBC connection which is about to be released- Throws:
SQLException- Since:
- 7.1
-
getEventMonitor
-
getEventManager
Deprecated, for removal: This API element is subject to removal in a future version.UsegetEventMonitor().Obtain a reference to theEventMonitordressed up as an instance ofEventManager.- Since:
- 6.4
-
getEventMonitor().