{"record":{"id":"683f8507f5326792","repo":"hibernate/hibernate-orm","slug":"unable-to-resume-suspended-transaction","errorCode":null,"errorMessage":"Unable to resume suspended transaction","messagePattern":"Unable to resume suspended transaction","errorType":"exception","errorClass":"TransactionException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaIsolationDelegate.java","lineNumber":129,"sourceCode":"\t\t\treturn callable.call();\n\t\t}\n\t\tcatch ( HibernateException he ) {\n\t\t\texception = he;\n\t\t\tthrow he;\n\t\t}\n\t\tcatch ( Throwable throwable ) {\n\t\t\texception = throwable;\n\t\t\tthrow new HibernateException( \"Unable to perform isolated work\", throwable );\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\t// resume the JTA transaction we suspended\n\t\t\t\tresume( surroundingTransaction );\n\t\t\t}\n\t\t\tcatch ( Throwable throwable ) {\n\t\t\t\t// if the actual work had an error, use that; otherwise throw this error\n\t\t\t\tif ( exception == null ) {\n\t\t\t\t\tthrow new TransactionException( \"Unable to resume suspended transaction\", throwable );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\texception.addSuppressed( throwable );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void resume(Transaction surroundingTransaction) throws InvalidTransactionException, SystemException {\n\t\tif ( surroundingTransaction != null ) {\n\t\t\ttransactionManager.resume( surroundingTransaction );\n\t\t\tJTA_LOGGER.transactionResumed( surroundingTransaction );\n\t\t}\n\t}\n\n\tprivate Transaction suspend() throws SystemException {\n\t\tfinal var surroundingTransaction = transactionManager.suspend();\n\t\tif ( surroundingTransaction != null ) {","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaIsolationDelegate.java#L111-L147","documentation":"TransactionException from JtaIsolationDelegate's finally block: the isolated work succeeded, but resuming the suspended JTA transaction failed. (When the work itself failed, the resume error is attached as a suppressed exception instead — this standalone throw means the work is committed/done while the surrounding transaction context is lost.) The caller's transaction must be abandoned and restarted.","triggerScenarios":"After isolated work (ID generation, DDL helper) under JTA, TransactionManager.resume() throws — the suspended transaction timed out or was rolled back while the isolated work ran, or the TM is failing mid-operation.","commonSituations":"JTA transaction timeouts shorter than the duration of isolated work inside batch jobs; TM recovery or failover during long operations; heavy load extending work past the default timeout.","solutions":["Abort and restart the outer transaction — it cannot be safely continued after a failed resume","Increase the JTA transaction timeout above worst-case isolated-work duration","Move long isolated work (DDL, big generator segment allocation) out of transactional scope","Inspect TM logs for the resume failure reason before retrying"],"exampleFix":"# before: default 60s timeout, isolated work inside a batch job exceeds it\n# WildFly: /subsystem=transactions:write-attribute(name=default-timeout,value=60)\n\n# after: raise the timeout for jobs that suspend/resume transactions\n# WildFly: /subsystem=transactions:write-attribute(name=default-timeout,value=300)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (org.hibernate.TransactionException e) {\n  // resume failed after successful isolated work: treat the outer transaction as lost —\n  // roll back / abandon it, verify what the isolated work did on the DB, restart fresh\n}","preventionTips":["Raise the JTA transaction timeout above worst-case isolated-work duration","Keep isolated work (DDL, large generator allocations) out of long transactions","Alert on suspended-transaction timeouts in TM monitoring"],"tags":["hibernate","jta","transaction-resume","timeout"],"backgroundTag":"jta-transaction-resume-failed","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}