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 SoapClient 请求发送原始 XML 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01