php - Connection busy to MS SQL Server on Linux using Zend Framework 2 and ODBC Driver -


i needed migrate windows server setup linux (red hat 7.2) server. used pdo_sqlsrv driver on windows machine. on linux we've installed pdo_odbc driver. since zend framework 2 doesn't support out of box, figured out db configuration myself using zf2 api docs works now. configuration:

'db' => array(     'driver' => 'pdo',     'username' => 'ourdbusername',     'password' => 'ourdbpassword',     'dsn' => 'odbc:driver={sql server native client 11.0};uid=ourdbusername;pwd=ourdbpassword;database=ourdbname;server=ourserverip',     'charset' => 'utf-8' ), 

so far good. if run our application go expected till simple request fails every time details of object. can't make request working if remove other requests executed before it. chaining request in way doesn't help. error:

statement not executed (hy000 - 0 - [microsoft][sql server native client 11.0] connection busy results command (sqlexecute[0] @ /builddir/build/build/php-5.4.16/ext/pdo_odbc/odbc_stmt.c:254) - hy000) 

we tried set mars_connection (described here how fix native client error 'connection busy results command'? on answer of smozgur). don't have such /etc/odbc.ini file, /etc/odbcinst.ini file. our /etc/odbcinst.ini file looking now:

[odbc driver 11 sql server] description=microsoft odbc driver 11 sql server driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0 threading=1 usagecount=1 mars_connection=yes 

do miss in setup working?

i played around db connection , turns out adding 'mars_connection=yes;' dsn job.

'db' => array(     'driver' => 'pdo',     'username' => 'ourdbusername',     'password' => 'ourdbpassword',     'dsn' => 'odbc:driver={sql server native client 11.0};uid=ourdbusername;pwd=ourdbpassword;database=ourdbname;server=ourserverip;mars_connection=yes;',     'charset' => 'utf-8' ), 

hopefully can next searchers!


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -