hibernate/hibernate-orm · error · TransactionException

TransactionManager reported transaction status as unknown

Error message

TransactionManager reported transaction status as unknown

What it means

The adapter maps the JTA Status int to Hibernate's TransactionStatus via StatusTranslator; a null mapping means the TransactionManager reported a status Hibernate cannot translate - typically Status.STATUS_UNKNOWN or an unrecognized value. It is raised from the adapter's status reads (including begin()'s NOT_ACTIVE check) and means the TM cannot tell what state the transaction is in, usually after an internal TM error or while recovery is in progress.

Solutions

  1. Check TransactionManager logs - an earlier TM-level error usually explains the unknown status
  2. Let crash recovery finish, or restart the TM, before further transaction work
  3. Upgrade the JTA implementation if it emits non-standard status codes
  4. Avoid transaction operations during application/TM shutdown
Defensive patterns

Strategy: try-catch

Try / catch

catch (TransactionException e) {
    // 'TransactionManager reported transaction status as unknown'
    // Treat the environment as unhealthy: report, stop issuing transaction work
    alertOnTransactionManagerHealth(e);
}

Prevention

When it happens

Trigger: TransactionManager.getStatus() returning STATUS_UNKNOWN or an out-of-range/non-standard code, reached via Transaction.getStatus(), begin()'s status check, or the commit/rollback paths that read status.

Common situations: TM internal error or crash recovery in progress; a custom or buggy TransactionManager emitting invalid codes; transaction operations issued during TM/application shutdown.

Related errors


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

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaTransactionAdapterTransactionManagerImpl.java:91

				transactionManager.rollback();
				JTA_LOGGER.calledTransactionManagerRollback();
			}
			else {
				markRollbackOnly();
			}
		}
		catch (Exception e) {
			throw new TransactionException( "JTA TransactionManager.rollback() failed", e );
		}
	}

	@Override
	@Nonnull
	public TransactionStatus getStatus() {
		try {
			final var status = StatusTranslator.translate( transactionManager.getStatus() );
			if ( status == null ) {
				throw new TransactionException( "TransactionManager reported transaction status as unknown" );
			}
			return status;
		}
		catch (SystemException e) {
			throw new TransactionException( "JTA TransactionManager#getStatus failed", e );
		}
	}

	@Override
	public void markRollbackOnly() {
		try {
			transactionManager.setRollbackOnly();
		}
		catch (SystemException e) {
			throw new TransactionException( "Could not set transaction to rollback only", e );
		}
	}

View on GitHub (pinned to fad1729dce)