Baan的记录锁

Baan的record的update/delete要先锁定才能处理,

注意的是: Baan是一个事务对应一个锁的,如下:

 

function extern test.lock()

{

select tcmcs003.*

from   tcmcs003 for update

as set with 1 rows

selectdo

tcmcs003.dsca="test1"

db.update(ttcmcs003,db.retry)

commit.transaction()                  |* commit后,事务完结,其锁即解除.

 

tcmcs003.dsca="test2"           

db.update(ttcmcs003,db.retry)   |* 该行出错,报Record is not locked.

commit.transaction()

endselect

}

你可能感兴趣的:(记录)