I don't believe you can do a commit() following a setRollbackOnly(), use rollback() or commit().
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?