php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60363 DB2_I5_TXN_READ_COMMITTED not accepted
Submitted: 2011-11-23 09:43 UTC Modified: 2012-08-01 08:39 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: t dot ratschkowski at aswo dot com Assigned: rahulpriyadarshi (profile)
Status: Not a bug Package: ibm_db2 (PECL)
PHP Version: 5.3.8 OS: Ubuntu 10.04
Private report: No CVE-ID: None
 [2011-11-23 09:43 UTC] t dot ratschkowski at aswo dot com
Description:
------------
We cannot pass the i5_commit parameter to the db2_connect function. We got this 
Warning and the parameter is ignored:

Warning: db2_connect() [function.db2-connect]: Incorrect option setting passed



Test script:
---------------
$options = array('i5_commit' => DB2_I5_TXN_READ_COMMITTED ); 
$db2string="DRIVER={IBM DB2 ODBC DRIVER};DATABASE=XXXX;HOSTNAME=xxx.xxxx.com;PORT=446;PROTOCOL=TCPIP;UID=USER;PWD=PASS";
$conn=db2_connect($db2string, "", "", $options); 

if ($conn===false) { 
    die(); 
} 


db2_close($conn); 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-23 12:29 UTC] ambrish@php.net
Hi,

This option is only for native i5 applications. i.e. if the application is running with both server and client as i5.

Regards,
Ambrish Bhargava
 [2011-11-30 16:27 UTC] t dot ratschkowski at aswo dot com
Hi, thanks for the quick answer.

In general, are this i5 parameters possible on the intel side? Or did the client 
drivers don't accept these parameters?

I see in the case statement, the parameters are going to default case:
(ibm_db2.c)
else if (!STRCASECMP(opt_key, "i5_commit")) {
 	    pvParam = option_num;
	    switch (option_num) {
			case DB2_I5_TXN_READ_UNCOMMITTED:
			case DB2_I5_TXN_READ_COMMITTED:
			case DB2_I5_TXN_REPEATABLE_READ:
			case DB2_I5_TXN_SERIALIZABLE:
				/* override commit in php.ini */
				rc = SQLSetConnectAttr((SQLHDBC)
((conn_handle*)handle)->hdbc, SQL_ATTR_COMMIT, 
(SQLPOINTER)&pvParam, SQL_NTS);
				if ( rc == SQL_ERROR ) {
					_php_db2_check_sql_errors((SQLHSTMT)
((conn_handle*)handle)->hdbc, SQL_HANDLE_DBC, 
rc, 1, NULL, -1, 1 TSRMLS_CC);
				}
				break;
			case DB2_I5_TXN_NO_COMMIT:
				/* override commit in php.ini */
				rc = SQLSetConnectAttr((SQLHDBC)
((conn_handle*)handle)->hdbc, SQL_ATTR_COMMIT, 
(SQLPOINTER)&pvParam, SQL_NTS);
				if ( rc == SQL_ERROR ) {
					_php_db2_check_sql_errors((SQLHSTMT)
((conn_handle*)handle)->hdbc, SQL_HANDLE_DBC, 
rc, 1, NULL, -1, 1 TSRMLS_CC);
				}
				break;
			default:
				php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"i5_commit (DB2_I5_TXN_NO_COMMIT, 
DB2_I5_TXN_READ_UNCOMMITTED, DB2_I5_TXN_READ_COMMITTED, 
DB2_I5_TXN_REPEATABLE_READ, DB2_I5_TXN_SERIALIZABLE)");
	    }
 [2011-12-01 07:41 UTC] ambrish@php.net
Hi,

The code snippet you have provided is defined inside "#ifdef PASE" tag (see line #1277). So this portion will get compiled only on native i5 systems only.

Link: http://svn.php.net/viewvc/pecl/ibm_db2/trunk/ibm_db2.c?revision=316026&view=markup

Regards,
Ambrish Bhargava
 [2012-08-01 08:39 UTC] rahulpriyadarshi@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: rahulpriyadarshi
 [2012-08-01 08:39 UTC] rahulpriyadarshi@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Nov 29 04:01:23 2020 UTC