Hi Saki,
Il 26/11/2023 03:30, Saki Takamachi ha scritto:
The behavior in this case varies depending on the DB driver and is not unified.
MySQL, OCI, ODBC, and Firebird currently support PDO autocommit mode.
- MySQL always sets the new mode regardless of the state of the transaction,
resulting in an implicit commit.
- OCI does an explicit commit and sets the new autocommit mode.
- Firebird raises an error.
- ODBC does not implement this behavior in the first place (it is a bug)
I believe that code that changes the autocommit mode with a transaction open is
usually just forgetting to close the transaction. Therefore, in such cases, I
would like to unify the behavior by generating an error like Firebird.
I would appreciate any feedback on this proposal and whether this change
requires an RFC.
PDO's main goal was to make building db drivers easier, and it's not
meant to be a full DB abstraction layer.
As such, it is not expected that all databases behave the same,
especially for exotic functionality, such as autocommit.
My 2c
Cheers
--
Matteo Beccati
Development & Consulting - http://www.beccati.com/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php