{"record":{"id":"6038410dae3d820e","repo":"hibernate/hibernate-orm","slug":"execution-of-action-caused-managed-transaction-to","errorCode":null,"errorMessage":"Execution of action caused managed transaction to be completed","messagePattern":"Execution of action caused managed transaction to be completed","errorType":"exception","errorClass":"TransactionManagementException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/internal/TransactionManagement.java","lineNumber":56,"sourceCode":"\t\t\tthrow exception;\n\t\t}\n\t}\n\n\tprivate static void rollback(Transaction transaction, RuntimeException exception) {\n\t\t// an error happened in the action or during commit()\n\t\tif ( transaction.isActive() ) {\n\t\t\ttry {\n\t\t\t\ttransaction.rollback();\n\t\t\t}\n\t\t\tcatch ( RuntimeException e ) {\n\t\t\t\texception.addSuppressed( e );\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static void commit(Transaction transaction) {\n\t\tif ( !transaction.isActive() ) {\n\t\t\tthrow new TransactionManagementException(\n\t\t\t\t\t\"Execution of action caused managed transaction to be completed\" );\n\t\t}\n\t\t// The action completed without throwing an exception,\n\t\t// so we attempt to commit the transaction, allowing\n\t\t// any RollbackException to propagate. Note that when\n\t\t// we get here we know that the transaction is active\n\t\ttransaction.commit();\n\t}\n\n}\n","sourceCodeStart":38,"sourceCodeEnd":67,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/internal/TransactionManagement.java#L38-L67","documentation":"Error \"Execution of action caused managed transaction to be completed\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/internal/TransactionManagement.java:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not complete (commit/rollback) the container-managed transaction inside the action; let the container manage it.","Remove explicit commit/rollback calls when using JTA managed transactions."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}