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

Explain me about rollback and commit


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

New User


Joined: 26 Jul 2005
Posts: 55

PostPosted: Wed Dec 07, 2005 7:52 am
Reply with quote

hi
explain me about rollback and commit?
where we see the rollback and commit?
which is lowest locking mode?
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 411
Location: Colarado, US

PostPosted: Wed Dec 07, 2005 7:57 am
Reply with quote

Hi mf_karthik,

A commit occurs automatically at the end of the program, or by request one or more times during the execution of the program. Releases all locks acquired by the program since the last commit, so that other programs and users may obtain access to the data. Any open cursors are automatically closed. All database changes are made permanent.If any changes made to the tables are not appropriate, then all the changes must by rolled back resulting in the same state of data as they were prior to making changes. Release all locks acquired by the program.


Hope this helps.
Back to top
View user's profile Send private message
mf_karthik

New User


Joined: 26 Jul 2005
Posts: 55

PostPosted: Wed Dec 07, 2005 8:05 am
Reply with quote

thnks for your answers
explain me where we will see that?
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 411
Location: Colarado, US

PostPosted: Wed Dec 07, 2005 8:21 am
Reply with quote

Hi mf_karthik,

Quote:
where we see the rollback and commit?


check this link for more information

www-128.ibm.com/developerworks/db2/library/techarticle/dm-0505stolze2/
Back to top
View user's profile Send private message
Jag

New User


Joined: 07 Dec 2005
Posts: 30
Location: India

PostPosted: Sun Dec 11, 2005 12:59 pm
Reply with quote

HI,

After every logical unit of work the changes will be commited...If you want to commit in middile you will be giving explict...Commit or rollback...

we can see that in between the program


Exec Sql
Commit
End-Exec..

Or rollback

Exec Sql
Rollback
End-Exec..

This way we will be issueing the command inbetween the program when we like to commit or rollback ...


Cheers,
Jag.
Back to top
View user's profile Send private message
Guest







PostPosted: Sun Dec 11, 2005 7:37 pm
Reply with quote

hi,

rollback: if u happend to update a table and u thought the information is wrong.then you can roolback(this option will uncommit all your information entered)
commit:if u commit a table all the updations u made will become perminant means they reamin unchanged, and u will get a sink opint.

but the data definition curious automaticlly comments.

Cheers,
TVM Kishore
Back to top
senthilssg

New User


Joined: 09 Dec 2005
Posts: 64
Location: USA

PostPosted: Mon Dec 12, 2005 11:10 am
Reply with quote

Hi,

i want to add a one more point regarding this ,

Auto comit will occur for every statements which are all executed in SPUFI.

Regards,
senthil
Back to top
View user's profile Send private message
Jag

New User


Joined: 07 Dec 2005
Posts: 30
Location: India

PostPosted: Mon Dec 12, 2005 7:02 pm
Reply with quote

Hi,

Every query executed will not get commited in SPUFI unless you specfity default as COMMIT while entering the SPUFI..So you have a choice either to commit automatically or rollback automatically...If you specify rollback automatically then you have give explict commit in spufi to reflect the changes in the database.

Cheers,
Jag
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Tue Dec 13, 2005 5:49 pm
Reply with quote

Okay,

To summarize,

Commit and Rollback are transsaction control commands ( as described by CODD).
These commands are issued automatically / explicitely by application programs or users.

Commit Saves the changes
Rollback : Undo the changes till last commit ( explicit or implecit).

Almost every application programming interface provides the ways to issue these statements explicitely in the program.

More information on this can be found on any database manuals. All most all RDBMS should have a provision for this. ( DB2 has)

Thanks,
Parikshit
Back to top
View user's profile Send private message
speedcnu

New User


Joined: 27 Jan 2004
Posts: 6
Location: Hyderabad

PostPosted: Wed Dec 21, 2005 11:13 am
Reply with quote

Good Explanation on Commit and Rollback...Any one who have min knowledge on DB2 he/she can easily understand.
Thanks to All.. icon_lol.gif
Back to top
View user's profile Send private message
speedcnu

New User


Joined: 27 Jan 2004
Posts: 6
Location: Hyderabad

PostPosted: Wed Dec 21, 2005 11:18 am
Reply with quote

Good Explanation on Commit and Rollback...Any one who have min knowledge on DB2 he/she can easily understand.
Thanks to All.. icon_lol.gif
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Wed Oct 10, 2007 3:32 pm
Reply with quote

to add up one more,,,,

when a cursor declared with "WITH HOLD" option overrides the Commit command meaning the cursor will not be closed.

Cheers,
Neo icon_smile.gif
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 DB2 Statistics - Using EXPLAIN and qu... DB2 1
No new posts filter COMMIT/ROLLBACK statements DFSORT/ICETOOL 13
No new posts Commit limit for Delete query through... DB2 10
No new posts Can someone explain me this JCL line ... JCL & VSAM 9
No new posts Commit a DB2 Table on Unix Server and... DB2 3
Search our Forums:

Back to Top