Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dlesl/aws-advanced-jdbc-wrapper-spring-transaction-example


https://github.com/dlesl/aws-advanced-jdbc-wrapper-spring-transaction-example

Last synced: 19 days ago
JSON representation

Awesome Lists containing this project

README

        

### Example for https://github.com/awslabs/aws-advanced-jdbc-wrapper/issues/608

Without `DataSourceTransactionManagerConfig`, it is not possible to detect a
failover when the commit throws an `FailoverSQLException`. This is because the
Spring `TransactionManager` attempts to rollback in response to this exception.
The rollback fails, since it is a new connection with no active transaction, and
the rollback exception replaces the original `FailoverSQLException`.

`DataSourceTransactionManagerConfig` is workaround which overrides
`translateException` to convert a `FailoverSQLException` to a subclass of
`TransactionException`. When this exception is thrown, the Spring
`TransactionManager` does not attempt to rollback.