wood burning stoves 2.0*
The moose likes JDBC and the fly likes Problem in rolling back some transactions. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem in rolling back some transactions." Watch "Problem in rolling back some transactions." New topic
Author

Problem in rolling back some transactions.

Pooja Agarwal
Ranch Hand

Joined: May 19, 2004
Posts: 37
Hai All,

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.
Dillip Mohapatra
Greenhorn

Joined: Jul 07, 2004
Posts: 7
Hi 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.

Chao


Dillip Mohapatra
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem in rolling back some transactions.
 
Similar Threads
modal window problem
unable to roll back storedprocedures,,
EL expression - order of evaluation?
Filters and WLS 6.1 SP3 problem
Servicegen error BindingException