General discussion on Zend Server for IBM System i
Post Reply
Posts: 877
Joined: Thu Apr 09, 2009 5:45 pm


Post by aseiden » Tue Aug 24, 2010 6:09 pm

When I specify a blank user/password in db2_connect(), my understanding was that my queries would run inside the Apache jobs, avoiding the performance penalty of spawning QSQSRVR jobs.

I'm doing this in Zend Server, but find that QSQSRVR jobs are being spawned. (See the job log text below).

Is my understanding correct, or was this rule (avoiding user/password to avoid QSQSRVR jobs) only true with Zend Core?


within ZENDSVR joblog:

Message ID . . . . . . : SQL7908 Severity . . . . . . . : 00
Message type . . . . . : Completion
Date sent . . . . . . : 08/24/10 Time sent . . . . . . : 12:52:54

Message . . . . : Job 998546/QUSER/QSQSRVR used for SQL server mode
Cause . . . . . : A Structured Query Language (SQL) statement was executed
while running in SQL server mode. SQL statements for this connection or
thread will be processed in job 998546/QUSER/QSQSRVR.
Technical description . . . . . . . . : SQL server mode was requested by
either setting the SQL server mode job attribute, or by setting the server
mode environment attribute via the SQL Call Level Interface. When running
in this mode, SQL statements are processed by a separate job, which runs
under the user profile specified for the connection....

Posts: 61
Joined: Sat Mar 28, 2009 8:31 pm
Location: Italy

Re: QSQSRVR jobs

Post by darkluke980 » Wed Aug 25, 2010 11:05 am

Hi alan,

Same problem as ZendCore, if we don't insert this line in our php.ini "ibm_db2.i5_ignore_userid=1", not work ....



Posts: 877
Joined: Thu Apr 09, 2009 5:45 pm

Re: QSQSRVR jobs

Post by aseiden » Wed Aug 25, 2010 11:14 am

Hi, Luke,

Thank you very much. I will try it and report my results.


Posts: 222
Joined: Fri Jul 24, 2009 6:28 pm

Re: QSQSRVR jobs

Post by rangercairns » Mon Aug 30, 2010 3:47 pm

More info ...

There is a problem/bug in the ibm_db2 source code for db2_connect("","",""), it will be fixed in a later release, but as the previous poster observed ... try ibm_db2.i5_ignore_userid=1, it is a better/safer way anyway ...

User workaround add ibm_db2.i5_ignore_userid=1.

Code: Select all

EDTF STMF('/usr/local/ZendSvr/etc/conf.d/ibm_db2.ini')
CMD ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+
     ************Beginning of data**************
     ************End of Data********************
ibm_db2.i5_ignore_userid=1 is the recommended way to set your entire site configuration to force/override all db2_connect(db,uid,pwd) to db2_connect(db,NULL,NULL).

Technically speaking ...
ibm_db2.i5_ignore_userid=1 leaves SQL_ATTR_SERVER_MODE == false, therefore no QSQ jobs.

CLI manual ...
As soon as SQL server mode has been set (db2_connect(db,uid,pwd)), all SQL connections and SQL statements run in server mode (including db2_connect("","","")). There is no switching back and forth.

Without using SQL server mode, applications might encounter one or more of the following limitations:
* A single job can have only one commit transaction per activation group.
* A single job can be connected to a relational database (RDB) only once.
* All SQL statements run under the user profile of the job, regardless of the user ID passed on the connection.

Posts: 877
Joined: Thu Apr 09, 2009 5:45 pm

Re: QSQSRVR jobs

Post by aseiden » Mon Aug 30, 2010 4:22 pm

Thanks, Tony, for the great information.

In addition, I've found that in order to avoid QSQSRVR jobs, I must use non-persistent connections.

That is, I must use db2_connect, not db2_pconnect, because persistent connections force QSQSRVR jobs to be created. Non-persistent jobs don't.

By the way, Tony, it was interesting that you edited ibm_db2.ini rather than php.ini. Any reason to edit one or the other?


Posts: 158
Joined: Mon Mar 23, 2009 5:22 pm

Re: QSQSRVR jobs

Post by zend_i5 » Mon Aug 30, 2010 4:58 pm

In Zend Core you need to edit PHP.ini file and Zend Server edit ibm_db2.ini. PHP in Zend Server scans ./etc directory for PHP directives which lets you add extensions directives either to PHP.INI file or to extensions configuration files like ibm_db2.ini

Posts: 877
Joined: Thu Apr 09, 2009 5:45 pm

Re: QSQSRVR jobs

Post by aseiden » Mon Aug 30, 2010 5:08 pm

Thanks, zend_i5,

So if I understand this, in Zend Core we could only modify PHP.INI, but with Zend Server we have a choice of modifying PHP.INI or the extension's ini, such as ibm_db2.ini.

Which method do you prefer? I'd think modifications to PHP.INI would be easier to find, centralized in one file. What other considerations are there?


Post Reply