首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
使用swoole时,一直有报pdo的错误,不知是什么原因
### 问题描述 SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. 看了下swoole的日志都是如下的错误: Exception Error 1: Uncaught Swoole\Error: Socket#34 has already been bound to another coroutine#107, reading of the same socket in coroutine#109 at the same time is not allowed in ...这种错误,有开自动协程与连接池
发布于6年前 · 37 次浏览 · 来自
提问
xilin693
### 问题描述 SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. 看了下swoole的日志都是如下的错误: Exception Error 1: Uncaught Swoole\Error: Socket#34 has already been bound to another coroutine#107, reading of the same socket in coroutine#109 at the same time is not allowed in ...这种错误,有开自动协程与连接池
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2020-07-14
鲁飞
请按模板提问,贴出相关代码和配置信息。
赞
0
回复
2020-07-14
xilin693
回复
鲁飞
swoole是4.4版本,php7.2,是任意有调用mysql的地方,都会有这个提示,所以没法帖出代码,不是每次出现,一个页面连点几次就有可能出现这个错误提示,刷新后就不会了,然后再点几次又会出现.
赞
0
回复
2020-07-15
B
Billy
代码中是不是有相同PDO 却多个协程复用问题,
赞
0
回复
2020-07-15
xilin693
回复
Billy
谢谢,应该是这个问题.
赞
0
回复
2021-01-12
GG
回复
xilin693
请问这个问题要怎么解决,如果我想同步查询多个sql语句,而且是协程态 如下代码: ```php for($id=1414,$i=0;$i<50;$i++){ go(function() use($id, $channel){ $condition = ['id' => $id, 'status' => 1, 'isDeleted' => 0]; \app\modules\warehouse\models\po\Warehouse::findOne($condition); $id = mt_rand(1000, 4000); }); } ``` 也是会有一样的错误,是只能用连接池来解决吗
赞
0
回复