Package org.hibernate.resource.transaction
package org.hibernate.resource.transaction
Defines the resource-level transaction capabilities of Hibernate, centered
around the
TransactionCoordinator
contract.
An instance of TransactionCoordinator may be constructed using a
TransactionCoordinatorBuilder,
which is a Service and available via the
StandardServiceRegistry.
Resource-local transaction
A resource-local transaction is exposed to the application as an instance ofTransaction, allowing full control over the
transaction lifecycle. That control flows from the Transaction into
the TransactionCoordinator via its exposed
TransactionCoordinator.TransactionDriver.
Physical transaction
It is the underlying physical transaction which ultimately controls the database transaction. This might be:- a JTA transaction, represented by a
TransactionorUserTransaction, or - a "JDBC transaction", as expressed via the JDBC
Connection.
The corresponding concrete implementations of TransactionCoordinator
manage the necessary bridging.
Local Synchronization
The Hibernate transaction API allows the application itself to register JTASynchronization objects with the
TransactionCoordinator. These local Synchronizations work in
all transaction environments.
See Transaction.registerSynchronization(jakarta.transaction.Synchronization) and
SynchronizationRegistry for
additional details.
-
ExceptionsClassDescriptionWraps an exception thrown from a "local synchronization" (one registered in the SynchronizationRegistry).Indicates an attempt to register a null synchronization.Indicates a call to
TransactionCoordinator.explicitJoin()that requires an active transaction where there currently is none.