![]() Laravel, on the other side, does not seem to want to address the issue, and leave it to a comment on MySQL in their documentation ![]() Doctrine DDL migrations produce errors on PHP 8.0 MySQL in transactional mode doctrine/migrations#1104.Yii: PHP 8 - "There is no active transaction" when transaction is autocommitted yiisoft/yii2#18406.The issue is that PDO does not have any notification of this change of status, and if not careful when calling the ->commit or '->rollback` methods on your transaction, the exception is now raised in PHP 8.0, as there is no transaction any more indeed.Īs an aside, IMHO, it is a correct thing for PHP/PDO to raise an exception to inform that the transaction is not one anymore, but this is a bit late in the process, as there is no notification in the abstraction between PDO and MySQL that the status has changed, so layers above PDO have to distrust the transaction abstraction layer, and take preventive or corrective actions to restore (or more realistically remediate) a more transactional mode.Īnyway, the consequence is that the exception bubbles up to webtrees.Īddressing this issue is not easy, as it is usually too late, so rollback is not possible anymore, but some of the frameworks have taken on themselves to deal with the exception in their framework layers (with usually the approach of silently ignoring on a attempted commit, and raising a warning on a attempted rollback): WEBTREES UPGRADE FAILED DRIVERAs several discussions highlight, the behaviour is actually not really new, but PHP 8.0 now raise explicitly an exception when the transaction does not exist anymore, instead of hiding that fact and continuing, as it did before.īasically, MySQL has a list of statement ( ) -in particular any DDL change - which force a commit, whatever has been instructed beforehand by the code or driver (I have tried playing with PDO::ATTR_AUTOCOMMIT to no avail), so whatever transaction was previously open is forcibly committed and closed. With a quick Google search, it appears to be actually a well-known "new" behaviour of PDO in PHP 8.0 with MySQL implicit commits. The table is actually created, and (if no other error otherwise), in the context of a updateSchema, all the actions have completed and been committed, and on a refresh of the page, the error does not appear anymore. #4 …\vendor\oscarotero\middleland\src\Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\DoHousekeeping->process() #3 …\app\Http\Middleware\DoHousekeeping.php(74): Middleland\Dispatcher->handle() ![]() #2 …\vendor\oscarotero\middleland\src\Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseTransaction->process() #1 …\app\Http\Middleware\UseTransaction.php(46): Illuminate\Database\Connection->transaction() #0 …\vendor\illuminate\database\Concerns\ManagesTransactions.php(45): PDO->commit() There is no active transaction …\vendor\illuminate\database\Concerns\ManagesTransactions.php:45 ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |