php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69286 commitment setting should make more simple.
Submitted: 2015-03-24 14:07 UTC Modified: 2015-07-21 21:01 UTC
From: satoruyoshida@php.net Assigned: rangercairns (profile)
Status: Wont fix Package: ibm_db2 (PECL)
PHP Version: Irrelevant OS: IBM i
Private report: No CVE-ID: None
 [2015-03-24 14:07 UTC] satoruyoshida@php.net
Description:
------------
Hello, I feel db2 commitment control setting is difficult to both understand myself and teach to anothers. 
You can find 4 methods how to control. 

by php.ini setting:
ibm_db2.i5_allow_commit

by db2_connect options:
 autocommit
 i5_commit

by function:
db2_autocommit()

by SQL statement:
* SET TRANSACTION ISOLATION LEVEL
* SELECT ... FOR UPDATE 
(I hear the SELECT ... FOR UPDATE statement could lock at Zend Server for IBM i 5.0.1 with ibm_db2 1.8.3 )


I propose following changes:

* ibm_db2.i5_allow_commit
 - Remove from php.ini. Relation between the i5_allow_commit and isolation level is hard to understand.

* autocommit in db2_connect option.
 - Remove from db2_connect options. 
   You have chance both autocommit and transaction at the same time in past ?

* i5_commit
 - Remove. we should make rule to use db2_transaction() in future version instead of db2_connect.

db2_autocommit()
 - Remove. if db2_autocommit(false), it is unclear which isolation level is used for me.

   we should make rule not to use db2_transaction() after db2_connect if you run PHP script with auto commitment. 


* SET TRANSACTION ISOLATION LEVEL
* SELECT ... FOR UPDATE 
 - I think these statement could be replaced to db2_transaction($i5_commit = DB2_I5_TXN_READ_COMMITTED) in future .

Thanks


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-17 06:13 UTC] rahulpriyadarshi@php.net
-Assigned To: +Assigned To: rangercairns
 [2015-06-22 14:10 UTC] adc at us dot ibm dot com
Working as designed, no fix planned.

Appears you do not understand difference between topics auto-commit and isolation level (i5_commit). Please refer to http://yips.idevcloud.com/wiki/index.php/PHP/DB2Connection (section Commit/Isolation level control).

Briefly, i5_commit=0-4 contorls isolation level, which, when uses by ALL processes involved will control locking during transactions, in fact, perfectly suited to admin control setting in ibm_db2.ini. On other hand, auto-commit (DB2_AUTOCOMMIT_ON/OFF), is better controlled on a task basis, wherein, script decides to allow the machine to control the transaction instantly (ON), or script controlled commit/rollback (OFF). In general, this would be a bad ibm_db2.ini setting, as the deafult ON saves people from there own ignorance on this topic when using persistent connections (everything rolls back random time).

The machine default IBM i CLI for 10-20 years has been read uncommitted, which, requires journal on libraries to work correctly. However, i5_commit=0, isolation level *NONE, unique to IBM i, is allowed for very old databases that have not enabled journal in the container (library). Of course, any modernization should include journal enabled, therefore, 1.9.7 has simply moved out of the way. 

However, surprising number of 400 customers still needing i5_commit=0 (*NONE), libraries without journal, so, Zend may choose to ship ibm_db2.ini with i5_commit=0 (a bit embarrassing in modern world).
 [2015-07-21 18:41 UTC] rangercairns@php.net
Reject.

Topics auto-commit (DB2_AUTOCOMMIT_ON/OFF) and isloation level (i5_commit), are not the same. Settings for isolation in ini file are desirable (i5_commit=0-4), but task based auto-commit is not a candidate for ini file (DB2_AUTOCOMMIT_ON/OFF).

Refer to http://yips.idevcloud.com/wiki/index.php/PHP/DB2Connection (section Commit/Isolation level control).
 [2015-07-21 21:01 UTC] rangercairns@php.net
-Status: Assigned +Status: Wont fix
 [2015-07-21 21:01 UTC] rangercairns@php.net
close
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC