niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » IBM DB2
COMMIT statements in a stored procedure
Post new topic   Reply to topic Page 1 of 1 [10 Posts] View previous topic :: View next topic
Author Message
Vincent M
*nix forums Guru


Joined: 22 Feb 2005
Posts: 1332

PostPosted: Thu Jul 13, 2006 3:16 pm    Post subject: COMMIT statements in a stored procedure Reply with quote

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?
Back to top
Serge Rielau
*nix forums Guru


Joined: 29 Apr 2005
Posts: 1583

PostPosted: Fri Jul 14, 2006 3:16 pm    Post subject: Re: COMMIT statements in a stored procedure Reply with quote

Mark A wrote:
Quote:
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/ondemandbusiness/conf2006/
Back to top
Vincent M
*nix forums Guru


Joined: 22 Feb 2005
Posts: 1332

PostPosted: Fri Jul 14, 2006 3:45 pm    Post subject: Re: COMMIT statements in a stored procedure Reply with quote

"Serge Rielau" <srielau@ca.ibm.com> wrote in message
news:4hpqp2FntssU2@individual.net...
Quote:
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.
Back to top
Ian
*nix forums Guru Wannabe


Joined: 02 Aug 2005
Posts: 262

PostPosted: Fri Jul 14, 2006 7:57 pm    Post subject: Re: COMMIT statements in a stored procedure Reply with quote

Mark A wrote:
Quote:
"Serge Rielau" <srielau@ca.ibm.com> wrote in message
news:4hpqp2FntssU2@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/infocenter/db2luw/v8/topic/com.ibm.db2.udb.doc/admin/r0000908.htm
Back to top
Vincent M
*nix forums Guru


Joined: 22 Feb 2005
Posts: 1332

PostPosted: Fri Jul 14, 2006 10:05 pm    Post subject: Re: COMMIT statements in a stored procedure Reply with quote

"Ian" <ianbjor@mobileaudio.com> wrote in message
news:44b7f649$1_4@newsfeed.slurp.net...
Quote:

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/infocenter/db2luw/v8/topic/com.ibm.db2.udb.doc/admin/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.
Back to top
Matt Emmerton
*nix forums addict


Joined: 21 Oct 2004
Posts: 76

PostPosted: Sat Jul 15, 2006 3:32 am    Post subject: Re: COMMIT statements in a stored procedure Reply with quote

Mark A wrote:
Quote:
"Ian" <ianbjor@mobileaudio.com> wrote in message
news:44b7f649$1_4@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/infocenter/db2luw/v8/topic/com.ibm.db2.udb.doc/admin/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
Back to top
Vincent M
*nix forums Guru


Joined: 22 Feb 2005
Posts: 1332

PostPosted: Sat Jul 15, 2006 4:01 am    Post subject: Re: COMMIT statements in a stored procedure Reply with quote

"memmerto@yahoo.com" <matt@gsicomp.on.ca> wrote in message >
Quote:
Driver types are different than connection types.


Really?
Back to top
Knut Stolze
*nix forums Guru


Joined: 28 Jul 2005
Posts: 755

PostPosted: Mon Jul 17, 2006 7:16 am    Post subject: Re: COMMIT statements in a stored procedure Reply with quote

Mark A wrote:

Quote:
"memmerto@yahoo.com" <matt@gsicomp.on.ca> wrote 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
Back to top
Vincent M
*nix forums Guru


Joined: 22 Feb 2005
Posts: 1332

PostPosted: Mon Jul 17, 2006 8:32 am    Post subject: Re: COMMIT statements in a stored procedure Reply with quote

"Knut Stolze" <stolze@de.ibm.com> wrote in message
news:e9fdg7$7e7$2@lc03.rz.uni-jena.de...
Quote:
Yes, of course. Both are completely different things.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany

You are a true genius!
Back to top
Serge Rielau
*nix forums Guru


Joined: 29 Apr 2005
Posts: 1583

PostPosted: Mon Jul 17, 2006 12:05 pm    Post subject: Re: COMMIT statements in a stored procedure Reply with quote

Mark A wrote:
Quote:
"Knut Stolze" <stolze@de.ibm.com> wrote in message
news:e9fdg7$7e7$2@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/ondemandbusiness/conf2006/
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [10 Posts] View previous topic :: View next topic
The time now is Mon Dec 01, 2008 11:32 pm | All times are GMT
navigation Forum index » Databases » IBM DB2
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts postfix smtp authentication using mysql stored user/pass rtresidd Postfix 0 Fri Oct 03, 2008 5:58 am
No new posts How to ALTER a table using the ALTOBJ procedure Serge Rielau IBM DB2 1 Fri Jul 21, 2006 1:06 pm
No new posts How do I render JPEG Data stored in char* buffer? On the Sparrow C++ 2 Thu Jul 20, 2006 8:44 pm
No new posts calling stored procedure using ECPG Jasbinder Bali PostgreSQL 1 Thu Jul 20, 2006 7:53 pm
No new posts Error while calling an Oracle Stored Procedure from VB us... macca Server 5 Thu Jul 20, 2006 9:32 am

Vacation Homes | Power Rangers | Debt Management | Debt Consolidation | Car Credit
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2215s ][ Queries: 16 (0.1025s) ][ GZIP on - Debug on ]