This content has been marked as final.
Show 2 replies
-
1. Re: jta transactions - simple question
genman Nov 17, 2006 8:08 PM (in response to vitor_b)I don't believe you can do a commit() following a setRollbackOnly(), use rollback() or commit().
-
2. Re: jta transactions - simple question
vitor_b Nov 17, 2006 9:35 PM (in response to vitor_b)Hello
Thank you for your answer. I put uT.setRollbackOnly() only to check what would happen. Now I've changed this line to:
throw new Exception("dark force exception")
and rollback method in catch (Exception ex) works quite fine.
So i belive that failed commit() method is the reason of missed transaction.
I belive also that when i can mark transaction for rolback i must check if the transaction is marked for rollback before call commit() method.
I think the best way will be replace commit() with:if (uT.getStatus() == Status.STATUS_MARKED_ROLLBACK) throw new Exception("dark force exception"); else uT.commit();
I think throwing an exception is a good thing. Exception will be caught, and efter rollback will be thrown to the client.
Thanks to that client will know that something wrong has happened.
Am I right?
vitor_b