Page 1 of 1

Recognize uncommitted transaction

Posted: Mon 15 Sep 2008 07:45
by mariusz
I have an idea to make a button for the users with MyTransaction.Commit when in the transaction are the uncommitted data.
I want to recognize are there uncommitted insert/update/delete queries. Uncommitted select should not highlight “Commit” button. How to provide this? Can anyone help me?

regards
M

Posted: Tue 16 Sep 2008 07:38
by Plash
You can add some variable to hold the transaction state. Add also handlers for the AfterExecute and AfterUpdateExecute events for all TBCQuery components. The code may look like the following:

procedure TForm1.IBCQuery1AfterExecute(Sender: TObject; Result: Boolean);
begin
if not TCustomIBCDataSet(Sender).IsQuery then
HasUncommitedTransaction := True;
end;

procedure TForm1.IBCQuery1AfterUpdateExecute(Sender: TDataSet;
StatementTypes: TStatementTypes; Params: TDAParams);
begin
if [stInsert, stUpdate, stDelete] * StatementTypes [] then
HasUncommitedTransaction := True;
end;

Posted: Tue 16 Sep 2008 09:26
by mariusz
Thx for your ansfer. I thought, that there is an easyer way to recognize it (by any properties for example)

M.

Re: Recognize uncommitted transaction

Posted: Tue 08 Apr 2014 23:30
by mariusz
Hi... As you can see... some time ago I asked you for a way to detect uncommited transaction. Your solution was so good, so it survived for years. Unfortunately when I upgraded my IBDAC to the version dated on February the 27'th, it does not work anymore. I got a messages:

Undeclared Identifier stInsert, stDelete and
Incompatible types: 'Integer' and '_TStatementtype'

Can you tip me what to use in this case?

regards
Mario

Re: Recognize uncommitted transaction

Posted: Wed 09 Apr 2014 06:07
by ZEuS
To solve the problem, you should add the DASQLGenerator module to the Uses section.
We will change this behavior in the next IBDAC build, so there will be no need to add the DASQLGenerator unit to the USES clause.

Re: Recognize uncommitted transaction

Posted: Wed 09 Apr 2014 16:33
by mariusz
Thank you :)

Re: Recognize uncommitted transaction

Posted: Thu 10 Apr 2014 04:18
by ZEuS
We thank you for your interest in our products.
Feel free to contact us if you have any further questions about IBDAC.