ASHISH GUPTA
New User
Joined: 20 Jan 2006 Posts: 1
|
|
|
|
My query is :
Suppose I have a main module having a number of Insert/update SQL's.
The main module calls a submodule which too has number of Insert/update SQL's. I have not specified COMMIT anywhere in either of thse modules. Now, suppose after a successful call to the submodule, my main module abends, will the updates/inserts in made in my submodule be reflected, i.e committed?
I have this query because of a situation I faced during testing my module. My subprogram abends after inserting 3 records with sqlcode -803 for the 4th record.
But I find that the 3 previous records inserted are getting reflected in my database. Also, an update I made in my main calling module is also getting reflected.
Since I have not specified COMMIT anywhere in both of my programs, any idea how this can happen?
Also, does DB2 ever automatically commit data after say N number of records, even if I haven?t specified COMMIT in the program?
Thanks a lot in advance for your valuable time.
Regards,
Ashish Gupta |
|
prabs2006
Active User
Joined: 12 Jan 2006 Posts: 103
|
|
|
|
Hi Ashish,
This seems to be an interesting scenario..A commit happens when it is explicitly stated or when the program terminates successfully.
But in your case, it is a sub program which has been terminated, may be this might be the reason for the data being reflected.
A clarification reqd from ur side: Did you merely saw the inserted data in the table or did u queried the inserted data? Sometimes it is possible that u can look at the data in the table but u will be unable to fetch it. If this is the case ur data is not commited.
Please keep updated us with ur progress
Thanks & Regards
Prabs |
|