{"record":{"id":"ce9101933162ece7","repo":"hibernate/hibernate-orm","slug":"jta-usertransaction-getstatus-failed","errorCode":null,"errorMessage":"JTA UserTransaction.getStatus() failed","messagePattern":"JTA UserTransaction\\.getStatus\\(\\) failed","errorType":"exception","errorClass":"TransactionException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaTransactionAdapterUserTransactionImpl.java","lineNumber":97,"sourceCode":"\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new TransactionException( \"JTA UserTransaction.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( userTransaction.getStatus() );\n\t\t\tif ( status == null ) {\n\t\t\t\tthrow new TransactionException( \"UserTransaction 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 UserTransaction.getStatus() failed\", e );\n\t\t}\n\t}\n\n\t@Override\n\tpublic void markRollbackOnly(){\n\t\ttry {\n\t\t\tuserTransaction.setRollbackOnly();\n\t\t}\n\t\tcatch (SystemException e) {\n\t\t\tthrow new TransactionException( \"Unable to mark transaction for rollback only\", e );\n\t\t}\n\t}\n\n\t@Override\n\tpublic void setTimeOut(int seconds) {\n\t\tif ( seconds > 0 ) {\n\t\t\ttry {\n\t\t\t\tuserTransaction.setTransactionTimeout( seconds );","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaTransactionAdapterUserTransactionImpl.java#L79-L115","documentation":"UserTransaction.getStatus() threw SystemException, wrapped as 'JTA UserTransaction.getStatus() failed'. Hibernate cannot read transaction state at all; like the TransactionManager variant, this signals an environment- or transaction-manager-level failure (stopped TM, stale UT handle, corrupt TM) rather than a problem with one specific transaction.","triggerScenarios":"Any status read on the UT path - begin()'s NOT_ACTIVE check or getStatus() - while userTransaction.getStatus() throws SystemException: TM stopped, the UT bound from a dead JNDI resource, or TM corruption after a crash.","commonSituations":"UT handle obtained from JNDI that no longer backs a live TM; TM shutdown in progress; severe failures after a crash.","solutions":["Inspect the wrapped SystemException and the TM logs","Re-verify the JtaPlatform and the JNDI binding used for the UserTransaction","Restart or recover the TM when it is in a terminal state"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Health-check the UT before relying on transactions\ntry {\n    ut.getStatus();\n}\ncatch (SystemException e) {\n    throw new IllegalStateException(\"UserTransaction is not usable\", e);\n}","typeGuard":null,"tryCatchPattern":"catch (TransactionException e) {\n    if ( e.getCause() instanceof SystemException ) {\n        // UT/TM-level failure: surface environment health, fail fast\n    }\n}","preventionTips":["Smoke-test the UserTransaction at startup","Verify the JNDI binding backs a live TM","Alert on repeated SystemException from UT operations"],"tags":["jta","transactions","hibernate","usertransaction","transaction-manager"],"backgroundTag":"transaction-status-check-failed","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}