hibernate/hibernate-orm · error · HibernateException
Unable to resume JTA transaction after DDL execution
Error message
Unable to resume JTA transaction after DDL execution
What it means
HibernateException from DdlTransactionIsolatorJtaImpl.release(): after DDL completed, TransactionManager.resume(suspendedTransaction) threw. The DDL work itself is done, but the original JTA transaction could not be re-associated with its thread, so the caller's transaction context is broken and must be abandoned.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/DdlTransactionIsolatorJtaImpl.java:110
if ( jdbcConnection != null ) {
try {
jdbcContext.getJdbcConnectionAccess().releaseConnection( jdbcConnection );
}
catch (SQLException e) {
throw jdbcContext.getSqlExceptionHelper()
.convert( e, "Unable to release JDBC Connection used for DDL execution" );
}
}
if ( suspendedTransaction != null ) {
try {
getJtaPlatform( jdbcContext )
.retrieveTransactionManager()
.resume( suspendedTransaction );
JTA_LOGGER.resumedTransactionForDdlIsolation();
}
catch (Exception e) {
throw new HibernateException( "Unable to resume JTA transaction after DDL execution" );
}
}
}
}
View on GitHub (pinned to fad1729dce)
Solutions
- Abort and restart the affected transaction — it cannot be safely continued after this
- Move DDL out of transactions entirely (migration tooling) so nothing is suspended
- Raise the JTA transaction timeout above the worst-case DDL duration for maintenance runs
- Check TM logs for why the transaction was rejected on resume (timed out / marked rollback)
Example fix
// before
props.put("hibernate.hbm2ddl.auto", "update"); // DDL inside JTA; long DDL -> resume fails
// after
// run DDL in a maintenance step with no active transaction, then:
props.put("hibernate.hbm2ddl.auto", "validate"); Defensive patterns
Strategy: try-catch
Try / catch
catch (org.hibernate.HibernateException e) {
// resume failed after DDL: the surrounding transaction is unusable — abort it,
// verify DDL results on the DB, and restart the operation with a fresh transaction
} Prevention
- Run DDL outside active JTA transactions (maintenance mode, migration tooling)
- Set the JTA transaction timeout above worst-case DDL duration
- Watch TM logs for suspended-transaction timeouts during long operations
When it happens
Trigger: The suspended transaction timed out, rolled back, or became otherwise unresumable during long DDL execution; the TM raises InvalidTransactionException/SystemException on resume; TM failover or recovery occurred mid-DDL.
Common situations: Long schema updates executed while a live JTA transaction is suspended whose timeout expired; app-server managed transactions mixed with manual DDL; batch maintenance windows exceeding default transaction timeouts.
Related errors
- DdlTransactionIsolatorJtaImpl could not locate TransactionMa
- Unable to suspend current JTA transaction in preparation for
- Unable to resume suspended transaction
- No create schema syntax supported by " + getClass().getName(
- No drop schema syntax supported by " + getClass().getName()
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/1b16264ccff0ca4c.
Report an issue: GitHub.