18.04.2020 16:45, Mark Rotteveel wrote:
Between 4.0.0.1820 and 4.0.01876 something has changed with the commit behaviour of a selectable stored procedure under a transaction using isc_tpb_autocommit.

I have a test in Jaybird[1] that executes a stored procedure with a loop that inserts a row in a table and then suspends the count of inserted rows. Jaybird fetches individual rows and after each row it will count the number of inserted rows in the table using a separate connection.

In 4.0.0.1820, when the select from the stored procedure was executed, but not yet fetched, the number of rows seen by the other transaction was 0, but in 4.0.0.1876 the number of rows seen by the other transaction is 1.

This would seem to indicate that either Firebird now prefetches a row from the stored procedure, or that previously the transaction boundary of isc_tpb_autocommit was after the suspend, but is now after the insert itself or at suspend.

  Firebird now internally prefetched first row when statement is executed.
It allows to unify and simplify request restart logic in read consistency
transactions.

Was this change intentional?

  Yes

> Jaybird itself uses this test to verify if it is really using 
isc_tpb_autocommit or not (with the 'standard' autocommit of Jaybird,
> the commit would only happen after the stored procedure execution is 
complete).

  Seems Firebird's autocommit should follow same rule - commit after all rows 
fetched

Regards,
Vlad


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to