I am finding diff in rolling back some transactions. Actually in my application (ie in Servlet) i have 5 callable statements to execute 5 stored procedures. cstmt1,cstmt2,cstmt3,cstmt4,cstmt5 I have one connection object.
I have to execute these stored procedures in sequence. If any stored procedures returns non zero value i have to stop
execution and roll back all the transactions. If all the 5 stored procedures return 0 then i have to commit the transaction. i have used the following logic to do so. But the problem is, i am failing to rollback the tranaction. SP5 is returning non zero value, its displaying "error in SP5", but is not rolling back all the transactions. Plz let me know how to roll back all the transactions. Is there any mistake in my logic. ??
SP2 and SP3 are executed more than once and are included in for loop.
SP = Stored procedure.
Any help would be appreciated. Thanks in advance POOJA.
I just went through the history of queries posted by you. From that, what I could understand, the possibility of the error segment can be 1. either you need to make sure that you wanted to execute all the callable statements using the same connection. 2. check your stored procedures, if there is any bug, like commit within itself.
Otherwise, code, logic looks fine.
subject: Problem in rolling back some transactions.