{"record":{"id":"115a3ab4f9172768","repo":"hibernate/hibernate-orm","slug":"could-not-determine-resourcelocaltransactionaccess","errorCode":null,"errorMessage":"Could not determine ResourceLocalTransactionAccess to use in building TransactionCoordinator","messagePattern":"Could not determine ResourceLocalTransactionAccess to use in building TransactionCoordinator","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jdbc/internal/JdbcResourceLocalTransactionCoordinatorBuilderImpl.java","lineNumber":43,"sourceCode":"\tpublic static final String SHORT_NAME = \"jdbc\";\n\n\t/**\n\t * Singleton access\n\t */\n\tpublic static final TransactionCoordinatorBuilder INSTANCE = new JdbcResourceLocalTransactionCoordinatorBuilderImpl();\n\n\t@Override\n\t@Nonnull\n\tpublic TransactionCoordinator buildTransactionCoordinator(TransactionCoordinatorOwner owner, Options options) {\n\t\tif ( owner instanceof JdbcResourceTransactionAccess transactionAccess ) {\n\t\t\treturn new JdbcResourceLocalTransactionCoordinatorImpl(\n\t\t\t\t\tthis,\n\t\t\t\t\towner,\n\t\t\t\t\ttransactionAccess\n\t\t\t);\n\t\t}\n\n\t\tthrow new HibernateException(\n\t\t\t\t\"Could not determine ResourceLocalTransactionAccess to use in building TransactionCoordinator\"\n\t\t);\n\t}\n\n\t@Override\n\tpublic boolean isJta() {\n\t\treturn false;\n\t}\n\n\t@Override\n\t@Nonnull\n\tpublic PhysicalConnectionHandlingMode getDefaultConnectionHandlingMode() {\n\t\treturn DELAYED_ACQUISITION_AND_RELEASE_AFTER_TRANSACTION;\n\t}\n\n\t@Override\n\t@Nonnull\n\tpublic DdlTransactionIsolator buildDdlTransactionIsolator(JdbcContext jdbcContext) {","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jdbc/internal/JdbcResourceLocalTransactionCoordinatorBuilderImpl.java#L25-L61","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nprops.put(\"hibernate.transaction.coordinator_class\", \"jdbc\"); // custom owner -> HibernateException at bootstrap\n\n// after\n// let the environment decide, or be explicit per runtime\nprops.put(\"hibernate.transaction.coordinator_class\", isJtaRuntime ? \"jta\" : \"jdbc\");","handlingStrategy":"validation","validationCode":"// if you build coordinators yourself, verify the owner matches the builder first\nif (!(owner instanceof org.hibernate.resource.transaction.jdbc.spi.JdbcResourceTransactionAccess)) {\n  throw new IllegalStateException(\n      \"JDBC resource-local coordinator requires a JdbcResourceTransactionAccess owner\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["hibernate","configuration","transaction-coordinator","bootstrap","spi"],"backgroundTag":"invalid-configuration","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}