From: Serge Rielau on
John Hopfield wrote:
> Maybe the transaction is already active?
> The CALL of my Stored Procedure should terminate with a COMMIT? (i
> never put "COMMIT" at end of my Stored Procedure)
If you were Pinocchio I'd say: "Listen to the grasshopper".
Locks have be held until the transaction commits.
Ideally your application should do this. But you add the COMMIT in your
procedure as well if it encapsulates a complete transaction.
In addition (not as a substitute) you also want to look at setting
DB2_SKIP_INSERTED. Generally a good feature.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
From: John Hopfield on
On 30 Giu, 13:47, Serge Rielau <srie...(a)ca.ibm.com> wrote:
> If you were Pinocchio I'd say: "Listen to the grasshopper".

:) (i live 100Km from Collodi :) )

> Locks have be held until the transaction commits.
> Ideally your application should do this. But you add the COMMIT in your
> procedure as well if it encapsulates a complete transaction.

I have tried to add a "COMMIT" at the end of my Stored Procedure.
But nothing is changed.

> In addition (not as a substitute) you also want to look at setting
> DB2_SKIP_INSERTED. Generally a good feature.

i will search the documentation of DB2_SKIP_INSERTED..

JH
From: John Hopfield on
On 30 Giu, 15:14, John Hopfield <Hopfi...(a)freemail.it> wrote:
> I have tried to add a "COMMIT" at the end of my Stored Procedure.
> But nothing is changed.

Must i disconnect from DB2 and re-connect every-time?
(or close and open SQL querys ?)
JH
From: Serge Rielau on
John Hopfield wrote:
> On 30 Giu, 15:14, John Hopfield <Hopfi...(a)freemail.it> wrote:
>> I have tried to add a "COMMIT" at the end of my Stored Procedure.
>> But nothing is changed.
>
> Must i disconnect from DB2 and re-connect every-time?
> (or close and open SQL querys ?)
> JH
You definitely do not need to disconnect/reconnect. That would be really
bad for performance.

I don't know what close and open queries mean in your context....

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
From: Dave Hughes on
John Hopfield wrote:

> On 30 Giu, 13:47, Serge Rielau <srie...(a)ca.ibm.com> wrote:
> > If you were Pinocchio I'd say: "Listen to the grasshopper".
>
> :) (i live 100Km from Collodi :) )
>
> > Locks have be held until the transaction commits.
> > Ideally your application should do this. But you add the COMMIT in
> > your procedure as well if it encapsulates a complete transaction.
>
> I have tried to add a "COMMIT" at the end of my Stored Procedure.
> But nothing is changed.

You don't need a COMMIT in the stored proc definition - you need to
commit the transaction in your client's code.

My Delphi knowledge is rather rusty (v6), but you should find a Commit
method on the connection object (depending on the connection
architecture you're using ... I think the ADO components used something
different like EndTran, but all the rest used methods named Commit and
Rollback). Anyway - that's what you'll need to call to commit the
transaction.


Cheers,

Dave.