469,306 Members | 2,457 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

simple SELECT sets exclusive locks on table

We have developed a large PHP application using adodb-4.22, php-4.2.2
and IBM DB2 v8.2 and saw that simple select statements in our code like

Execute('select * from sesys.role order by role_id')

place unwanted exclusive locks on the table referenced in the SQL
statement.

If we ask the database which statement has actually been executed, it
tells us

select * from sesys.role order by role_id FOR UPDATE.

Does adodb add the "FOR UPDATE" clause automatically and how can we
suppress this? As there is no native support for DB2 in adodb, the ODBC
driver is used. Do we have a problem with the ODBC driver. What can we
do about it?

Feb 1 '06 #1
4 2329
mi*************@tietoenator.com wrote:
We have developed a large PHP application using adodb-4.22, php-4.2.2
and IBM DB2 v8.2 and saw that simple select statements in our code like

Execute('select * from sesys.role order by role_id')

place unwanted exclusive locks on the table referenced in the SQL
statement.

If we ask the database which statement has actually been executed, it
tells us

select * from sesys.role order by role_id FOR UPDATE.
This problem is caused by PHP.
Does adodb add the "FOR UPDATE" clause automatically and how can we
suppress this?


Execute('select * from sesys.role order by role_id for read only')

Btw, you might want to use the newer IBM DB2 PHP driver as the odbc code is
pretty buggy.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Feb 1 '06 #2
We would like to upgrade to a newer version of PHP and a newer IBM DB2
PHP driver, but our customer is a litte hesitant.

Isn't it possible to fix our problem using the odbc_setoption()
function which internally calls SQLSetStmtOption() or
SQLSetConnectOption()?

Feb 1 '06 #3
mi*************@tietoenator.com wrote:
We would like to upgrade to a newer version of PHP and a newer IBM DB2
PHP driver, but our customer is a litte hesitant.

Isn't it possible to fix our problem using the odbc_setoption()
function which internally calls SQLSetStmtOption() or
SQLSetConnectOption()?


I don't know if PHP 4 allows that (or PHP 5 for that matter). What speaks
against appending the FOR READ ONLY clause?

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Feb 1 '06 #4
mi*************@tietoenator.com wrote:
We would like to upgrade to a newer version of PHP and a newer IBM DB2
PHP driver, but our customer is a litte hesitant.

Isn't it possible to fix our problem using the odbc_setoption()
function which internally calls SQLSetStmtOption() or
SQLSetConnectOption()?

The DB2 engine has the apability.
What you need is the BLOCKING ALL bind option:
http://publib.boulder.ibm.com/infoce...e/r0001935.htm
When teh access is through CLI (which I think ODBC is, you shoudl be
able to rebind the cli packages with that option:
http://publib.boulder.ibm.com/infoce...e/r0001935.htm

Hope that helps
Serge
--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Feb 1 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Sunny K | last post: by
3 posts views Thread by LineVoltageHalogen | last post: by
4 posts views Thread by pike | last post: by
1 post views Thread by peaceburn | last post: by
5 posts views Thread by Roger | last post: by
3 posts views Thread by Arun Srinivasan | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.