• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in rolling back some transactions.

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic