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 of Transaction, 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 Transaction or UserTransaction, 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 JTA Synchronization objects with the TransactionCoordinator. These local Synchronizations work in all transaction environments.

See Transaction.registerSynchronization(jakarta.transaction.Synchronization) and SynchronizationRegistry for additional details.