Subject | The PHP default transaction |
---|---|
Author | Tim Ward |
Post date | 2016-01-21T10:44:10Z |
I've got a long running (hours) PHP script which does large numbers
(tens of thousands) of database operations along the lines of
start explicit transaction
do something in that transaction
commit that transaction
the idea being not to hold any individual transaction open for a long
time and, thereby, not to open up a transaction number gap and hold up
garbage collection.
But we see from the MON$ tables what looks like a transaction that
starts at the beginning of the script and remains in existence
throughout the lifetime of the script. This transaction is marked
"inactive".
(1) Is this likely to be the "default transaction" that PHP creates for
a connection if you don't do an explicit start transaction? Ie, does PHP
create the default transaction for a connection even if you never use it
(rather than create it on first use, as one might have hoped)?
(2) What, if anything, is the import of a transaction being marked
"inactive"? Does an "inactive" transaction still freeze the various
transaction counters and hold up garbage collection?
(3) If the answer to (2) is that the existence of this transaction *is*
a potential performance problem, I imagine I can get rid of it simply by
doing "ibase_commit();" at the start of the PHP script?
--
Tim Ward
(tens of thousands) of database operations along the lines of
start explicit transaction
do something in that transaction
commit that transaction
the idea being not to hold any individual transaction open for a long
time and, thereby, not to open up a transaction number gap and hold up
garbage collection.
But we see from the MON$ tables what looks like a transaction that
starts at the beginning of the script and remains in existence
throughout the lifetime of the script. This transaction is marked
"inactive".
(1) Is this likely to be the "default transaction" that PHP creates for
a connection if you don't do an explicit start transaction? Ie, does PHP
create the default transaction for a connection even if you never use it
(rather than create it on first use, as one might have hoped)?
(2) What, if anything, is the import of a transaction being marked
"inactive"? Does an "inactive" transaction still freeze the various
transaction counters and hold up garbage collection?
(3) If the answer to (2) is that the existence of this transaction *is*
a potential performance problem, I imagine I can get rid of it simply by
doing "ibase_commit();" at the start of the PHP script?
--
Tim Ward