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 > Commit a Nested Stored Procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-19-09, 13:05
Gustavo Oviedo Gustavo Oviedo is offline
Registered User
 
Join Date: Mar 2009
Posts: 1
Commit a Nested Stored Procedure

I have an external Stored Procedure which calls a Sql Stored Procedure. It seems that a commit can not be apply in my sql Stored Procedure while the external stored procedure is not finished.


I have explicity written the commit sentence in the sql Stored Procedure but does not work

How can I tell the Procedure to behave independently from the object that calls it (program, external stored procedure, user function)?

Thanks
Reply With Quote
  #2 (permalink)  
Old 03-19-09, 14:15
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Please supply your DB2 version and OS.

How do you know it is not working?

Andy
Reply With Quote
  #3 (permalink)  
Old 03-19-09, 17:06
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
Gustavo,
In a case like that you would have to kick off an asynchronous process, instead of calling your procedure. For instance use an MQ transaction, on the mainframe we would have a process start a batch job, so that the task is done separately or to kick off a CICS transaction, which would do the piece of work.
Reply With Quote
  #4 (permalink)  
Old 03-20-09, 03:16
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Adding to what dav1mo said, a stored procedure is like any regular function/method in an application: it executes in the context of the caller. For stored procedures, that means the same transactional context of the caller - it is as if your application would execute the logic in the procedure itself within the very same transaction.
__________________
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