IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Savepoint & Rollback


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shell100

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Thu May 07, 2009 3:43 pm
Reply with quote

Need help to understand the significance of putting save point & rollback as below in the case described below

----------------------------------------------------------
EXEC SQL
SAVEPOINT A ON ROLLBACK RETAIN CURSORS
END-EXEC.
-----------------------------------------------------------
IF ERROR-FOUND

EXEC SQL
ROLLBACK TO SAVEPOINT A
END-EXEC
-----------------------------------------------------------

Lets take the scenario -
User1 invoked the SP to update Row1 which will take Save point - A
User2 also invoked the same SP to update Row2 which will again take Save point. Lets assume this transaction get completed.
Now user1 got some issue due to which rollback happened. Would it Rollback included updation done by User2 or it would only rollback user1 transaction.

Thanks in advance
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 07, 2009 8:14 pm
Reply with quote

Hello,

User1 will not rollback work done by user2.
Back to top
View user's profile Send private message
shell100

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Tue May 12, 2009 2:42 pm
Reply with quote

Thanks Dick!!

Just to understand - would both the savepoints be different for both Stored proc transactions?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 12, 2009 7:40 pm
Reply with quote

Hello,

Yes. Each logical unit of work is managed separately.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts filter COMMIT/ROLLBACK statements DFSORT/ICETOOL 13
No new posts TWA variable having junk value after ... CICS 1
No new posts Handle ROLLBACK in EXCI interface CICS 12
No new posts Rollback does not remove messages? Java & MQSeries 5
No new posts MQ ROLLBACK? Java & MQSeries 6
Search our Forums:

Back to Top