473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

COMMIT statements in a stored procedure

Quoted from the: "Application Development Guide: Programming Server
Applications Version 8.2": (DB2 for LUW).

"Stored procedures cannot issue COMMIT or ROLLBACK statements if the stored
procedure was invoked from an application that established a type 2
connection to the database."

1. Is this accurate?

2. If a stored procedure is tested from the CLP (using type 2 connection to
a remote database), does that mean that no intermediate commits in the SP
are actually being done and that the only commit is done by auto-commit of
the client?
Jul 13 '06 #1
9 7272
Mark A wrote:
Quoted from the: "Application Development Guide: Programming Server
Applications Version 8.2": (DB2 for LUW).

"Stored procedures cannot issue COMMIT or ROLLBACK statements if the stored
procedure was invoked from an application that established a type 2
connection to the database."

1. Is this accurate?
I have no reason to disbelieve it
>
2. If a stored procedure is tested from the CLP (using type 2 connection to
a remote database), does that mean that no intermediate commits in the SP
are actually being done and that the only commit is done by auto-commit of
the client?
The text above suggests that the COMMIT in the procedure will fail with
a negative SQLCODE.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Jul 14 '06 #2
"Serge Rielau" <sr*****@ca.ibm.comwrote in message
news:4h***********@individual.net...
>2. If a stored procedure is tested from the CLP (using type 2 connection
to a remote database), does that mean that no intermediate commits in the
SP are actually being done and that the only commit is done by
auto-commit of the client?
The text above suggests that the COMMIT in the procedure will fail with a
negative SQLCODE.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
It definitely does not fail with an SQL error in my test. I will do some
further testing.
Jul 14 '06 #3
Ian
Mark A wrote:
"Serge Rielau" <sr*****@ca.ibm.comwrote in message
news:4h***********@individual.net...
>>2. If a stored procedure is tested from the CLP (using type 2 connection
to a remote database), does that mean that no intermediate commits in the
SP are actually being done and that the only commit is done by
auto-commit of the client?
The text above suggests that the COMMIT in the procedure will fail with a
negative SQLCODE.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

It definitely does not fail with an SQL error in my test. I will do some
further testing.
Are you actually making a Type-2 Connection? (i.e. so your program
that calls the stored procedure can have 1 transaction that spans 2
separate databases)? See:

http://publib.boulder.ibm.com/infoce...n/r0000908.htm


Jul 14 '06 #4
"Ian" <ia*****@mobileaudio.comwrote in message
news:44**********@newsfeed.slurp.net...
>
Are you actually making a Type-2 Connection? (i.e. so your program
that calls the stored procedure can have 1 transaction that spans 2
separate databases)? See:

http://publib.boulder.ibm.com/infoce...n/r0000908.htm
No, I am connecting to a single database with a type 2 driver, and that
explains it. Maybe that is not the best wording in the manual.
Jul 14 '06 #5

Mark A wrote:
"Ian" <ia*****@mobileaudio.comwrote in message
news:44**********@newsfeed.slurp.net...

Are you actually making a Type-2 Connection? (i.e. so your program
that calls the stored procedure can have 1 transaction that spans 2
separate databases)? See:

http://publib.boulder.ibm.com/infoce...n/r0000908.htm

No, I am connecting to a single database with a type 2 driver, and that
explains it. Maybe that is not the best wording in the manual.
Driver types are different than connection types.

For example, JDBC defines four different driver types, two of which DB2
support (types 2 and 4).

--
Matt Emmerton

Jul 15 '06 #6
"me******@yahoo.com" <ma**@gsicomp.on.cawrote in message >
Driver types are different than connection types.
Really?
Jul 15 '06 #7
Mark A wrote:
"me******@yahoo.com" <ma**@gsicomp.on.cawrote in message >
>Driver types are different than connection types.

Really?
Yes, of course. Both are completely different things.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Jul 17 '06 #8
"Knut Stolze" <st****@de.ibm.comwrote in message
news:e9**********@lc03.rz.uni-jena.de...
Yes, of course. Both are completely different things.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
You are a true genius!
Jul 17 '06 #9
Mark A wrote:
"Knut Stolze" <st****@de.ibm.comwrote in message
news:e9**********@lc03.rz.uni-jena.de...
>Yes, of course. Both are completely different things.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany

You are a true genius!
*rofl*

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Jul 17 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Markus Breuer | last post by:
I have a question about oracle commit and transactions. Following scenario: Process A performs a single sql-INSERT into a table and commits the transaction. Then he informs process B (ipc) to...
3
by: Alberto | last post by:
I've a complex stored procedure, that makes a lot of insert, update, delete and so on. I would like to make some commits durint this sp, but of course they are not "real" commit because who call...
0
by: jamiemcc | last post by:
Hi, I would like to have 1 stored procedure call another stored procedure (which contains multiple select statements) and then be able to access the 3 result sets. Example Create Procedure ....
3
by: Mark | last post by:
If a java applicaiton using the type 4 driver calls a DB2 stored procedure, does the stored procedure need to do its own commit when updates are completed? If the stored procedure does a commit or...
7
by: Ugrasena via DBMonster.com | last post by:
Hi team i am using DB2 7.2 on Windows2000. We have lot many SQL Procedure Calls, is there any way i can Turn off the Auto Commit on that Database, the Problem i have is many of our Application...
7
by: Matt Jensen | last post by:
Howdy Fairly simple question I think, I presume the answer is no it can't be reused for 2 *SELECT* statements, but just hoping for clarification. Just asking in the interests of trying to minimise...
2
by: Ryan | last post by:
I've re-written a stored procedure and when I post the following code into the existing SP in EM, is saves OK. However, when I re-edit the SP, the last line 'Commit Transaction' has been removed. ...
2
by: =?Utf-8?B?VGVycnk=?= | last post by:
I have coded multiple select statements in a single stored procedure, and when I execute this procedure on SQL Server Management Express, I correctly get multiple result sets. But, if I try to add...
4
by: vertigo262 | last post by:
Is it possible to use to select statements in a stored procedure? I am building a movie rating system, what I am doing is creating a table with movies and individual user ratings. The code...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.