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

Does DB2 ever automatically commit data


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

New User


Joined: 20 Jan 2006
Posts: 1

PostPosted: Fri Jan 20, 2006 12:26 pm
Reply with quote

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
Back to top
View user's profile Send private message
prabs2006

Active User


Joined: 12 Jan 2006
Posts: 103

PostPosted: Fri Jan 20, 2006 3:22 pm
Reply with quote

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
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 Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
Search our Forums:

Back to Top