Subject RE: [IBO] AutoCommit and TransactionState
Author IBO Support List
Thomas,

Would you be able to put together a little sample app demonstrating the
problem?

Jason

-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Thomas Lenders
Sent: Wednesday, April 24, 2013 1:16 AM
To: IBObjects@yahoogroups.com
Subject: AW: [IBO] AutoCommit and TransactionState

Hi Jason,

the action I was talking about was TIB_ActionCommitRetaining assigned to a
TButton.
The button is enabled or disabled in the StatusChanged procedure but my
problem is that the transaction state does not change after posting with
AutoCommit=TRUE.

As another way of explaining the problem, I found out that I can get the
behavior I would expect by adding an "AfterCommit" event on the transaction
and manually setting the transaction state with the following ugly
construct:

type TUglyHack = class(TIB_Transaction)
end;

procedure TMyForm.trAfterCommit(Sender: TIB_Transaction);
begin
TUglyHack(tr).SetTransactionState(tsInactive);
end;

I don't really feel comfortable to fiddle with the transaction's state
though that is why I was asking what is the explanation for the state
"ActivePending" after autocommit ?

I don't currently know how to better explain it, hope this helps. The IBO
version I am using is "4.9.14 53".

Regards,
Thomas

Von: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] Im Auftrag
von IBO Support List
Gesendet: Dienstag, 23. April 2013 18:27
An: IBObjects@yahoogroups.com
Betreff: RE: [IBO] AutoCommit and TransactionState



I think I need to see more of the details of the code you are working with
to give you better guidance. What IBO-Actions are you talking about? It's
possible that I simply have a bug in those action handlers.

Thanks,
Jason

-----Original Message-----
From: IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>
[mailto:IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>] On
Behalf
Of Thomas Lenders
Sent: Monday, April 22, 2013 6:24 AM
To: IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>
Subject: [IBO] AutoCommit and TransactionState

Hey there,

I am struggling to understand the implications of using AutoCommit=TRUE.

There is an application that uses this behavior but the problem is that
before and after doing the auto-commit the transactions state is
"ActivePending".
This means that some IBO-actions on a toolbar don't get notified (by their
StatusChanged event) that a commit has happened.

Currently the problem is a "Save" button which should do a commit on the
current transaction that is still active even when no more changes need to
be committed.

More importantly, I'd like to understand a bit more about this behavior and
if there is some way to control it.. comments in the source code for the
"TransactionState" property say that after auto-commit the state could be
either "Inactive" or "ActivePending" but I don't understand how this is
decided.

Please help! :)

Regards,
Thomas

P.S.: I even started to entertain the idea to "simulate" the auto-commit
behavior by manually doing a commit after post, but I don't see a way to go
about it except for handling it on the query level..



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



------------------------------------

___________________________________________________________________________
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 !
Yahoo! Groups Links