{"record":{"id":"0d37b1408ed8ae47","repo":"hibernate/hibernate-orm","slug":"transactionmanager-reported-transaction-status-as-0d37b1","errorCode":null,"errorMessage":"TransactionManager reported transaction status as unknown","messagePattern":"TransactionManager reported transaction status as unknown","errorType":"exception","errorClass":"TransactionException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaTransactionAdapterTransactionManagerImpl.java","lineNumber":91,"sourceCode":"\t\t\t\ttransactionManager.rollback();\n\t\t\t\tJTA_LOGGER.calledTransactionManagerRollback();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmarkRollbackOnly();\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new TransactionException( \"JTA TransactionManager.rollback() failed\", e );\n\t\t}\n\t}\n\n\t@Override\n\t@Nonnull\n\tpublic TransactionStatus getStatus() {\n\t\ttry {\n\t\t\tfinal var status = StatusTranslator.translate( transactionManager.getStatus() );\n\t\t\tif ( status == null ) {\n\t\t\t\tthrow new TransactionException( \"TransactionManager reported transaction status as unknown\" );\n\t\t\t}\n\t\t\treturn status;\n\t\t}\n\t\tcatch (SystemException e) {\n\t\t\tthrow new TransactionException( \"JTA TransactionManager#getStatus failed\", e );\n\t\t}\n\t}\n\n\t@Override\n\tpublic void markRollbackOnly() {\n\t\ttry {\n\t\t\ttransactionManager.setRollbackOnly();\n\t\t}\n\t\tcatch (SystemException e) {\n\t\t\tthrow new TransactionException( \"Could not set transaction to rollback only\", e );\n\t\t}\n\t}\n","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaTransactionAdapterTransactionManagerImpl.java#L73-L109","documentation":"The adapter maps the JTA Status int to Hibernate's TransactionStatus via StatusTranslator; a null mapping means the TransactionManager reported a status Hibernate cannot translate - typically Status.STATUS_UNKNOWN or an unrecognized value. It is raised from the adapter's status reads (including begin()'s NOT_ACTIVE check) and means the TM cannot tell what state the transaction is in, usually after an internal TM error or while recovery is in progress.","triggerScenarios":"TransactionManager.getStatus() returning STATUS_UNKNOWN or an out-of-range/non-standard code, reached via Transaction.getStatus(), begin()'s status check, or the commit/rollback paths that read status.","commonSituations":"TM internal error or crash recovery in progress; a custom or buggy TransactionManager emitting invalid codes; transaction operations issued during TM/application shutdown.","solutions":["Check TransactionManager logs - an earlier TM-level error usually explains the unknown status","Let crash recovery finish, or restart the TM, before further transaction work","Upgrade the JTA implementation if it emits non-standard status codes","Avoid transaction operations during application/TM shutdown"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (TransactionException e) {\n    // 'TransactionManager reported transaction status as unknown'\n    // Treat the environment as unhealthy: report, stop issuing transaction work\n    alertOnTransactionManagerHealth(e);\n}","preventionTips":["Keep the TransactionManager patched and healthy; STATUS_UNKNOWN usually follows an earlier TM error","Do not run transactional work while crash recovery is active","Avoid transaction operations during application shutdown"],"tags":["jta","transactions","hibernate","status"],"backgroundTag":"transaction-status-unknown","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}