Hi all,
First of all, just want to let you know that I'm coming from
Informix background, and we just recently migrated to DB2. It's
been a great new learning experience. For the time being, I have
some questions regarding LOCK TIMEOUT and its compatibility with
LOCK MODE WAIT in INFOMIX.
Last week, I just found out that the following statement was
complied and built in Stored Procedure
SET LOCK MODE TO WAIT 5;
What I would like to achieve is for the application to wait for 5
seconds before it returns lock timeout error (SQLSTATE 40001).
And after I did some reading from DB2 Docs, that statement should
be equivalent to
SET CURRENT LOCK TIMEOUT 5;
But when I tested the stored procedure, I did not get the lock
timeout.
The Procedure waited indefinitely until I released the lock on the
table.
Does anyone know if this is a bug ? I am in contact with the support,
but
I would like to find out if anyone is experiencing the same thing. The
following is taken out of DB2 Information Center :
|WAIT integer-constant
| Specifies an integer value between -1 and 32767. A value of -1 is
| equivalent to specifying the WAIT keyword without an integer value.
| A value of 0 is equivalent to specifying the NOT WAIT clause. If the
| value is between 1 and 32767, the database manager will wait that
| number of seconds (if a lock cannot be obtained) before an error
|(SQLSTATE 40001 or SQLSTATE 57033) is returned.
|
|For compatibility with Informix:
|
| MODE can be specified in place of TIMEOUT.
| TO can be specified in place of the equals (=) operator.
| SET LOCK WAIT can be specified in place of
| SET CURRENT LOCK TIMEOUT WAIT.
| SET LOCK NO WAIT can be specified in place of
| SET CURRENT LOCK TIMEOUT NOT WAIT.
DB2 V.8.2 FIXPACK 8
LINUX SUSE 8
Thanks
N.