Can you please tell me how DB2 commit happens in batch and online programs (how it differs in both cases)? Please suggest me an article to learn about commit logic.
I thought of reading more about commit logic, when I came across a situation: Program A calls Program B to insert a row into a table one bye one. Program B inserts one row and goes back to Program A. So when the commit actually happens - 1) when program B return after inserting a single row or 2) when program A returns after entire update process. Both program A and B are batch programs. The forum has a similar post which says option 1 will be true. Please tell if you have any more idea in this.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
I thought of reading more about commit logic
Yes, you should.
The forum has a similar post which says option 1 will be true. Please tell if you have any more idea in this.
My idea is that you should neversimply trust something you read in a forum . . .
COMMIT is rather straight forward. Things not yet committed may be rolled back. Having said that, you now need to read about the various ways COMMIT / ROLLBACK might happen. Running some of your own experiments is also a good way to see these behaviors first-hand.
If you try some experiments and something "strange" happens, post what you did and what happened. Someone will be able to clarify.