I wrote an UDF that has to query another firebird database in order to get some information.
On the DLL initialization I create a IZConnection and on finalization I close it.
The problem is: When I close the Connection, if I have had previously executed any statement, the application hands when call isc_commit_transaction to commit the previously openned transaction.
I noticed that it hangs only when the commit ocurrs on my finalization code.
So, I tried to set AutoCommit to False on the connection, and then I do a commit after executing my query. As it's not the DLL finalization code, I could do a commit without problems.
But when I try to close the connection, this procedure is executed:
Code: Select all
if Closed then Exit;
if FTrHandle <> nil then
if AutoCommit then
Format('COMMITT TRANSACTION "%s"', [Database]));
end else begin
Format('ROLLBACK TRANSACTION "%s"', [Database]));
FTrHandle := nil;
CheckInterbase6Error(FPlainDriver, FStatusVector, lcDisconnect);
It checks if there is a transaction handle and, if true, do a commit or rollback depending on the AutoCommit property.
But wait, there are no pending transactions! I have openned only one and I have commited it, but the test FTrHandle <> nil is returning true!
So, I ask:
Shouldn't this transaction handle (FTrHandle) be set to nil after a commit/rollback operation?
I'm using Zeos 6.6.2 RC2 and Firebird 2.0