473,657 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

COMMIT statements in a stored procedure

Quoted from the: "Applicatio n 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 7307
Mark A wrote:
Quoted from the: "Applicatio n 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*****@mobile audio.comwrote in message
news:44******** **@newsfeed.slu rp.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*****@mobile audio.comwrote in message
news:44******** **@newsfeed.slu rp.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.o n.cawrote in message >
Driver types are different than connection types.
Really?
Jul 15 '06 #7
Mark A wrote:
"me******@yahoo .com" <ma**@gsicomp.o n.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
12697
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 read the new date. So process B starts "select ..." but does not get the previously inserted row. The timespan between commit and select is very short. (NOTE: two different sessions are used) Questions: 1.) Does commit when returning from call...
3
6619
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 the sp could decide for a rollback. But I know that this commit has to be real. In fact, the transaction log grows really too much during the execution.
0
2110
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 . exec Multiple --manipulate result set A
3
8717
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 rollback, does that affect the UOW for any SQL that was directly issued by the java program before calling the stored procedure?
7
6550
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 Dont Use Auto Commit = false, and if we have any Error in the SQL procedure say after Executing 10 Update and Insert Statements the DB2 is commiting all the Previous Statements, even though there was an Error, how can i prevent this from the Database...
7
2993
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 code. i.e. if the SqlDataAdapter uses a connection to the one database for a select statement and I want to do a second select statement on exactly the same database, can I reuse the SqlDataAdapter? I ask because I want to put both 'select'...
2
2225
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. I cannot save the remainder of the SP as it throws error 208 (Invalid Object name #Max) about two of the temp tables I use when I post the entire script. It shows in a message box with the header : 'Microsoft SQL-DMO(ODBC SQLState:42S02) I...
2
5085
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 a new Data Source to to my VB 2005 project, and point to this stored procedure, the data source wizard only sees the 'first' select statement. Is there a way to load multiple tables in a DataSet from a single stored procedure with multiple...
4
6928
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 needs to get a count of the ratings, then the sum of them to get the percentage. I am getting a error Exception Details: System.IndexOutOfRangeException: columncount
0
8324
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8516
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7353
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.