Knut Stolze wrote:[color=blue]
> pike wrote:
>[color=green]
>> DB2 UDB 8.1 FP7
>>
>> We are getting intermittent deadlocks (911 RC 2) even when U row-lock
>> has been secured.
>>
>> The transaction is as follows:
>> 1) Select current application number value from table. To guarantee
>> uniqueness of the application number SELECT FOR UPDATE statement is
>> used.
>> 2) Calculate new application number value.
>> 3) Store new application number value back to database with UPDATE
>> statement.[/color]
>
> How is the calculation in step 2 done? If it's not too complicated or can
> be wrapped in a UDF, then you could simply condense all three steps into a
> single one.
>[/color]
DB2 V8.1.4 for LUW and higher:
SELECT applnum FROM NEW TABLE(UPDATE T SET applnum = <blahexpr> WHERE
<blahpred>)
BTW, are you aware of APPLICATION_ID():
http://publib.boulder.ibm.com/infoce...n/r0011856.htm
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab