Class JdbcTransactionManager

All Implemented Interfaces:
Serializable, InitializingBean, ConfigurableTransactionManager, PlatformTransactionManager, ResourceTransactionManager, TransactionManager

public class JdbcTransactionManager extends DataSourceTransactionManager
JdbcAccessor-aligned subclass of the plain DataSourceTransactionManager, adding common JDBC exception translation for the commit and rollback step. Typically used in combination with JdbcTemplate which applies the same SQLExceptionTranslator infrastructure by default.

Exception translation is specifically relevant for commit steps in serializable transactions (for example, on Postgres) where concurrency failures may occur late on commit. This allows for throwing ConcurrencyFailureException to callers instead of TransactionSystemException.

Analogous to HibernateTransactionManager and JpaTransactionManager, this transaction manager may throw DataAccessException from AbstractPlatformTransactionManager.commit(org.springframework.transaction.TransactionStatus) and possibly also from AbstractPlatformTransactionManager.rollback(org.springframework.transaction.TransactionStatus). Calling code should be prepared for handling such exceptions next to TransactionException, which is generally sensible since TransactionSynchronization implementations may also throw such exceptions in their flush and beforeCommit phases.

Since:
5.3
Author:
Juergen Hoeller, Sebastien Deleuze
See Also: