hibernate/hibernate-orm · error · TransactionManagementException

Execution of action caused managed transaction to be…

Error message

Execution of action caused managed transaction to be completed

What it means

TransactionManagement invariant after running an action in a managed transaction: the user-supplied action itself completed or rolled back the surrounding transaction, so the framework commit step finds no active transaction to commit.

Solutions

  1. Do not complete (commit/rollback) the container-managed transaction inside the action; let the container manage it.
  2. Remove explicit commit/rollback calls when using JTA managed transactions.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at hibernate-core/src/main/java/org/hibernate/internal/TransactionManagement.java:56 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/6038410dae3d820e. Report an issue: GitHub.

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/internal/TransactionManagement.java:56

			throw exception;
		}
	}

	private static void rollback(Transaction transaction, RuntimeException exception) {
		// an error happened in the action or during commit()
		if ( transaction.isActive() ) {
			try {
				transaction.rollback();
			}
			catch ( RuntimeException e ) {
				exception.addSuppressed( e );
			}
		}
	}

	private static void commit(Transaction transaction) {
		if ( !transaction.isActive() ) {
			throw new TransactionManagementException(
					"Execution of action caused managed transaction to be completed" );
		}
		// The action completed without throwing an exception,
		// so we attempt to commit the transaction, allowing
		// any RollbackException to propagate. Note that when
		// we get here we know that the transaction is active
		transaction.commit();
	}

}

View on GitHub (pinned to fad1729dce)