hibernate/hibernate-orm · error · HibernateException
Could not determine ResourceLocalTransactionAccess to use in
Error message
Could not determine ResourceLocalTransactionAccess to use in building TransactionCoordinator
What it means
HibernateException from JdbcResourceLocalTransactionCoordinatorBuilderImpl: while building the JDBC resource-local TransactionCoordinator, the supplied TransactionCoordinatorOwner does not implement JdbcResourceTransactionAccess, so the coordinator has no JDBC transaction to drive. Standard SessionImpl owners implement it; custom owners or a wrong coordinator-class setting do not, making this a configuration/SPI wiring error.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jdbc/internal/JdbcResourceLocalTransactionCoordinatorBuilderImpl.java:43
public static final String SHORT_NAME = "jdbc";
/**
* Singleton access
*/
public static final TransactionCoordinatorBuilder INSTANCE = new JdbcResourceLocalTransactionCoordinatorBuilderImpl();
@Override
@Nonnull
public TransactionCoordinator buildTransactionCoordinator(TransactionCoordinatorOwner owner, Options options) {
if ( owner instanceof JdbcResourceTransactionAccess transactionAccess ) {
return new JdbcResourceLocalTransactionCoordinatorImpl(
this,
owner,
transactionAccess
);
}
throw new HibernateException(
"Could not determine ResourceLocalTransactionAccess to use in building TransactionCoordinator"
);
}
@Override
public boolean isJta() {
return false;
}
@Override
@Nonnull
public PhysicalConnectionHandlingMode getDefaultConnectionHandlingMode() {
return DELAYED_ACQUISITION_AND_RELEASE_AFTER_TRANSACTION;
}
@Override
@Nonnull
public DdlTransactionIsolator buildDdlTransactionIsolator(JdbcContext jdbcContext) {View on GitHub (pinned to fad1729dce)
Solutions
- Remove the explicit hibernate.transaction.coordinator_class and let Hibernate autodetect (jdbc for resource-local, jta when JTA is present)
- In JTA environments set coordinator class to jta (or the app-server-specific builder)
- If you truly need the JDBC coordinator with a custom owner, implement JdbcResourceTransactionAccess on that owner
Example fix
// before
props.put("hibernate.transaction.coordinator_class", "jdbc"); // custom owner -> HibernateException at bootstrap
// after
// let the environment decide, or be explicit per runtime
props.put("hibernate.transaction.coordinator_class", isJtaRuntime ? "jta" : "jdbc"); Defensive patterns
Strategy: validation
Validate before calling
// if you build coordinators yourself, verify the owner matches the builder first
if (!(owner instanceof org.hibernate.resource.transaction.jdbc.spi.JdbcResourceTransactionAccess)) {
throw new IllegalStateException(
"JDBC resource-local coordinator requires a JdbcResourceTransactionAccess owner");
} Prevention
- Let the runtime pick the coordinator: omit hibernate.transaction.coordinator_class unless required
- Let Spring/the app server configure transaction coordination instead of hard-coded properties
- After a Hibernate major upgrade, re-check custom SPI implementations against the new interfaces
When it happens
Trigger: hibernate.transaction.coordinator_class points at the JDBC (resource-local) builder while the session owner is a custom TransactionCoordinatorOwner (custom SessionFactoryOwner/integration/test harness) lacking JdbcResourceTransactionAccess; SPI code not updated for the 5.x to 6.x interface changes.
Common situations: In-house SessionFactory wrappers and custom bootstraps; copy-pasted legacy coordinator class names (e.g. org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionCoordinatorBuilderImpl) after an upgrade; forcing jdbc coordinator inside a JTA runtime where the JTA builder was required.
Related errors
- The {storageEngine} storage engine is not supported
- Could not instantiate event listener '{}'
- Unable to instantiate StatementObserver - {}
- Bootstrap registry should only contain provided services
- AbstractDelegatingMetadataBuildingOptions delegate did not i
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/115a3ab4f9172768.
Report an issue: GitHub.