If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > AutoCommit in Stored procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-06-08, 13:52
prem18 prem18 is offline
Registered User
 
Join Date: Apr 2007
Posts: 51
AutoCommit in Stored procedure

Friends

I am not sure of setting autocommit off in one of my stored prcedure.
Can any one help me .
I appreciate for any immediate help
Reply With Quote
  #2 (permalink)  
Old 10-07-08, 01:58
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 10-07-08, 02:21
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
I usually (but not always) do commits inside the stored procedure. One of the main benefits of a stored procedure is that it minimizes the elapsed time between multiple SQL statements (by running them back-to-back on the server). When I want to minimize the elapsed time of the Unit of Work, I commit as soon as possbile withiin the SP.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 10-13-08, 07:31
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
While Marcus has a good point, you should also think carefully about the context in which your SP may be called. A SP is called in a transaction/unit-of-work initiated by the caller, you will effectively commit the caller's transaction. That may be acceptable - or maybe not!
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On