{"record":{"id":"41773c02d40b5093","repo":"Activiti/Activiti","slug":"unable-to-suspend-transaction","errorCode":null,"errorMessage":"Unable to suspend transaction","messagePattern":"Unable to suspend transaction","errorType":"exception","errorClass":"TransactionException","httpStatus":null,"severity":"error","filePath":"activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/interceptor/JtaTransactionInterceptor.java","lineNumber":107,"sourceCode":"            throw new TransactionException(\"Unable to begin transaction\", e);\n        } catch (SystemException e) {\n            throw new TransactionException(\"Unable to begin transaction\", e);\n        }\n    }\n\n    private boolean isExisting() {\n        try {\n            return transactionManager.getStatus() != Status.STATUS_NO_TRANSACTION;\n        } catch (SystemException e) {\n            throw new TransactionException(\"Unable to retrieve transaction status\", e);\n        }\n    }\n\n    private Transaction doSuspend() {\n        try {\n            return transactionManager.suspend();\n        } catch (SystemException e) {\n            throw new TransactionException(\"Unable to suspend transaction\", e);\n        }\n    }\n\n    private void doResume(Transaction tx) {\n        if (tx != null) {\n            try {\n                transactionManager.resume(tx);\n            } catch (SystemException e) {\n                throw new TransactionException(\"Unable to resume transaction\", e);\n            } catch (InvalidTransactionException e) {\n                throw new TransactionException(\"Unable to resume transaction\", e);\n            }\n        }\n    }\n\n    private void doCommit() {\n        try {\n            transactionManager.commit();","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/Activiti/Activiti/blob/56435b1a97deeafdc09dd40074b056c89fba5a8a/activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/interceptor/JtaTransactionInterceptor.java#L89-L125","documentation":"Before running the command inside a new transaction, the interceptor suspends any existing transaction via TransactionManager.suspend(). A SystemException means the transaction manager failed to detach the current transaction from the thread; it is wrapped in a TransactionException.","triggerScenarios":"execute() calls doSuspend() and transactionManager.suspend() throws SystemException, e.g. the thread's transaction is in an illegal state for suspension.","commonSituations":"Calling engine commands while a container-managed transaction is active where suspension is disallowed; transaction manager bugs or incompatible JTA implementations.","solutions":["Do not invoke the engine inside a transaction context that cannot be suspended, or configure the engine to join rather than require new transactions","Verify JTA provider compatibility (e.g. Atomikos/Narayana versions) with Activiti's JTA interceptor","Inspect the SystemException cause to identify the illegal transaction state"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (tm.getStatus() != Status.STATUS_NO_TRANSACTION) { /* decide: join or explicitly suspend, do not rely on implicit suspend */ }","typeGuard":null,"tryCatchPattern":"try { engine.execute(cmd); } catch (TransactionException e) { if (e.getCause() instanceof SystemException && insideSuspension(e)) { /* restructure to avoid suspend */ } }","preventionTips":["Avoid invoking engine commands inside container-managed transactions that disallow suspension","Test your JTA provider's suspend/resume behavior before production"],"tags":["jta","transaction","activiti"],"backgroundTag":"transaction-suspend-failed","analyzedSha":"56435b1a97deeafdc09dd40074b056c89fba5a8a","analyzedAt":"2026-09-09T21:00:06.703Z","contentChangedAt":"2026-09-09T21:00:06.703Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}