Top Description Classes
[default module]

Package org.hibernate.resource.transaction


Defines the resource-level transaction capabilities of Hibernate, centered around the org.hibernate.resource.transaction.spi.TransactionCoordinator contract.

An instance of TransactionCoordinator may be constructed using a org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder, which is a org.hibernate.service.Service and available via the org.hibernate.boot.registry.StandardServiceRegistry.

Resource-local transaction

A resource-local transaction is exposed to the application as an instance of org.hibernate.Transaction, allowing full control over the transaction lifecycle. That control flows from the Transaction into the TransactionCoordinator via its exposed org.hibernate.resource.transaction.spi.TransactionCoordinator.TransactionDriver.

Physical transaction

It is the underlying physical transaction which ultimately controls the database transaction. This might be:

The corresponding concrete implementations of TransactionCoordinator manage the necessary bridging.

Local Synchronization

The Hibernate transaction API allows the application itself to register JTA jakarta.transaction.Synchronization objects with the TransactionCoordinator. These local Synchronizations work in all transaction environments.

See org.hibernate.Transaction#registerSynchronization and org.hibernate.resource.transaction.spi.SynchronizationRegistry for additional details.

Class Summary

Modifier and TypeClass and Description
public class
LocalSynchronizationException

Wraps an exception thrown from a "local synchronization" (one registered in the SynchronizationRegistry).

public class
NullSynchronizationException

Indicates an attempt to register a null synchronization.

public class
TransactionRequiredForJoinException

Indicates a call to TransactionCoordinator#explicitJoin() that requires an active transaction where there currently is none.