JTA Transaction: What happens if an exception happens but rollback is not called on the transaction?
- by kellyfj
We have some third party code wherein they do the following
1) Create a User Transaction e.g.
txn = (UserTransaction)ctx.lookup( "UserTransaction" );
txn.begin( );
2) Do some work persisting to the database (via JPA) to a MySQL database
3) txn.commit()
They have Exception blocks but NONE of them call txn.rollback.
Good coding practice says they NEED to call rollback if an exception occurs but my question is
If the txn is not commited, and an exception occurs what is the negative effect of them NOT calling rollback?