Transactions are not really designed to handle this sort of conditional logic. The idea behind them is you wrap up atomic pieces of work that are either successful and commit, or is unsuccessful and rolled back in their entirty. I suppose you could put some conditional logic in your catch statement that checks the SQLException's error message to see if it is from the second insert but it sounds a little flaky. You may just have to treat the three statements as seperate transactions an "rollback" in your code manually (i.e. issue a delete & update statements to undo what you've done).