How do I get connection pooling working on a PHP-CGI PDO iSeries Access UnixODBC Connection?(如何使连接池在 PHP-CGI PDO iSeries Access UnixODBC 连接上工作?)
问题描述
我正在尝试使用 PHP/PDO 和名为 iSeries Access for Linux 的 UnixODBC 驱动程序使连接池工作.
I am trying to get connection pooling working using PHP/PDO with a UnixODBC driver called iSeries Access for Linux.
我没有在我的 PDO 构造函数中设置 PDO::ATTR_PERSISTENT,因为我想使用池而不是持久性(我在 PHP-CGI 环境中).
I do not set the PDO::ATTR_PERSISTENT in my PDO constructor as I want to use pooling and not persistence (I am in a PHP-CGI environment).
使用 http://www 的连接池"部分.ibm.com/developerworks/systems/library/es-linux_bestpract.html我已经放了
Pooling = Yes
在我的 odbc.ini 和
in my odbc.ini and
CPTimeout = 600
在我的 odbcinst.ini 中
in my odbcinst.ini
但是,ODBC 驱动程序似乎不是连接池,因为每次页面刷新都会生成与正在建立的传入连接相关的 CPIAD09 消息.
However, it seems that the ODBC driver is not connection pooling because every page refresh generates the CPIAD09 related message of an incoming connection being made.
这是我的完整 ODBC 配置文件:
Here are my full ODBC configuration files:
==== odbc.ini ====
[AS400]
Description = Production AS/400 Database
Driver = iSeries Access ODBC Driver
System = XXX.XXX.X.X
UserID = XXXXXXXX
Password = XXXXXXXX
Naming = 0
DefaultLibraries = USERLIB, BPCSF, ADV, WEB, RITAUSR
Database =
ConnectionType = 0
CommitMode = 2
ExtendedDynamic = 0
DefaultPkgLibrary = QGPL
DefaultPackage = A/DEFAULT(IBM),2,0,1,0,512
AllowDataCompression = 1
LibraryView = 0
AllowUnsupportedChar = 0
ForceTranslation = 0
Trace = 0
DSN = AS400
Pooling = Yes
和
==== odbcinst.ini ====
[iSeries Access ODBC Driver]
Description = iSeries Access for Linux ODBC Driver
Driver = /opt/ibm/iSeriesAccess/lib/libcwbodbc.so
Setup = /opt/ibm/iSeriesAccess/lib/libcwbodbcs.so
NOTE1 = If using unixODBC 2.2.11 or later and you want the 32 and 64-bit ODBC drivers to share DSN's,
NOTE2 = the following Driver64/Setup64 keywords will provide that support.
Driver64 = /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
Setup64 = /opt/ibm/iSeriesAccess/lib64/libcwbodbcs.so
Threading = 2
DontDLClose = 1
UsageCount = 1
CPTimeout = 600
推荐答案
Pooling = Yes
这需要在您的 odbcinst.ini 而不是您的 odbc.ini 文件中的 [ODBC] 下进行
This needs to go under [ODBC] in you odbcinst.ini and NOT your odbc.ini file
CPTimeout = 600
把它放在你的 odbc.ini 中
Put this in your odbc.ini
这篇关于如何使连接池在 PHP-CGI PDO iSeries Access UnixODBC 连接上工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使连接池在 PHP-CGI PDO iSeries Access UnixODBC 连接上工作?
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- Laravel 仓库 2022-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01