JTA Transaction: What happens if an exception happens but rollback is not called on the transaction?

Posted by kellyfj on Stack Overflow See other posts from Stack Overflow or by kellyfj
Published on 2010-05-19T16:14:39Z Indexed on 2010/05/19 17:00 UTC
Read the original article Hit count: 245

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about java

Related posts about jta