Subject RE: [IBO] commit ending permanently
Author Kevin Stanton
Hi David,
I just threw a quick project together and can't get your error to happen.

Here's the project info:

Connection component.
Transaction component (ibt) - AutoCommit = True, Isolation = tiCommitted.

IB_Query:
select * from customers
order by custname
for update

IB_Datasource and IB Grid.


Button 1: called "Explicit" has the following code:

If NOT ibt.TransactionIsActive then
ibt.StartTransaction;
qryCusts.Edit;
qryCusts.FieldByName('CustName').AsString := 'ABCXYZ Customer';
qryCusts.Post;
ibt.CommitRetaining;

~~~~~~~~~~~~~~~~~~~~~~~~~
Button 2: called "TR AC Status"

If ibt.AutoCommit then
ShowMessage('AutoCommit = True')
else
ShowMessage('AutoCommit = FALSE');

~~~~~~~~~~~~~~~~~~~~~~~~~

When I simply change a customer's name, all is well.

When I hit Button 1 and then immediately change the 2nd customer's name in
the list, all works as planned -- the IB Transaction component seems to
automatically go back to "auto-commit" mode.


I'm using IBO Version 4.2.Gb w/ Delphi 6.


Kevin




-----Original Message-----
From: david_cornelius [mailto:corneliu@...]
Sent: Friday, July 26, 2002 11:12 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] commit ending permanently


Sorry about the <no subject>...

--- In IBObjects@y..., "david_cornelius" <corneliu@o...> wrote:
> I have an app using a TIB_Transaction with AutoCommit set to true.
> Most of the time, I let AutoCommit take care of the necessary
> transaction handling for me. But for a certain set of operations I
> need to take explicit control, so I call:
>
> trn.StartTranaction
> <<do some stuff>>
> trn.CommitRetaining
>
> Then I want to be able to have the same AutoCommit behavior, but
the
> next operation results in an error: "Invalid Internal
> IB_Transaction". Using CodeSite I notice that, as described in the
> help file, SavePoints are generated for the AutoCommit behavior
> before this, but after I have taken control with the code above and
> done the "CommitRetaining", I see that the transaction has ENDED
> and then I get the error even if I do an explicit StartTransaction
> right after CommitRetaining. Also, any other edits in the app
never
> get committed to the database.
>
> How do I get the AutoStart/AutoCommit behavior back again?
>
>
> Thanks,
>
> David Cornelius


Yahoo! Groups Sponsor
ADVERTISEMENT




___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
without the need for BDE, ODBC or any other layer.

___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



[Non-text portions of this message have been removed]