我在Symfony2中使用Doctrine,而不是PostgreSQL。
以前工作的代码已停止工作,仅在某些输入上有效。失败的案例向访问的Web浏览器发送500,并将以下内容发送到日志:
[2016-05-26 22:11:13] request.CRITICAL:未捕获的PHP异常Doctrine \ DBAL \ Exception \ DriverException:“执行'SELECT NEXTVAL('serp_id_seq')'时发生异常:SQLSTATE [25006] :只读sql事务:7错误:无法在只读事务中执行nextval()在/ var / www / my-project / releases / 20160314142327 / vendor / doctrine / dbal / lib / Doctrine / DBAL / Driver / AbstractPostgreSQLDriver .php第91行{“exception”:“[object](Doctrine \ DBAL \ Exception \ DriverException(code:0):执行'SELECT NEXTVAL('serp_id_seq')'时发生异常:\ n \ nSQLSTATE [25006]:只读sql事务:7错误:无法在/var/www/my-project/releases/20160314142327/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php的只读事务中执行nextval() :91,Doctrine \ DBAL \ Driver \ PDOException(代码:25006):SQLSTATE [25006]:只读sql事务:7错误:无法在/ var / www / my-project /的只读事务中执行nextval()发布/ 20160314142327 / VE ndor / doctrine / dbal / lib / Doctrine / DBAL / Driver / PDOConnection.php:106,PDOException(代码:25006):SQLSTATE [25006]:只读sql transaction:7错误:无法以只读方式执行nextval()交易在/var/www/my-project/releases/20160314142327/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104)“} []
Doctrine何时尝试在只读上下文中执行此操作?我该如何调试或修复它?我有doctrine / dbal 2.5.4,doctrine / orm 2.5.4和postgresql server 9.4.5