Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.1
-
None
Description
In the AriesTrader sample I wanted to test that the DataSource was being properly enlisted in the XA transaction. So I threw a RuntimeException immediately after persisting some entities expecting that the transaction would be rolled back and the entities not committed to the Database. However, the entities were actually committed to the DB.
It turns out that the blueprint bean method that I was using declared that it threw Exception and since RuntimeException is a subclass of Exception it considered this an expected exception and did not rollback the transaction. Much thanks to Brian De Pradine for figuring out what was going on here.
The transaction interceptor should check if the exception being thrown is a "RuntimeException" and if so perform the rollback.