From: Paul S. <pau...@ne...> - 2002-03-04 06:18:45
|
Steve Bate wrote: > I prefer to have the pessimistic locking supported at load time -- > either by the query language or through the persistence > API for loading objects. Allowing explicit lock upgrades after > loading would be nice for flexibility, but it also can lead to > deadlocks in the database if multiple objects are being loaded > and modified in a transaction. Deadlocks are nothing new. Databases have deadlock detection, and there's a mountain of litreature on how to avoid avoid it in the first place. It's not just "something nice" - it's a fundamental requirement if you're using pessimistic locks. > It's also effectively optimistic > locking since the data initially read may have changed between > the time you load the object and the time you upgrade the lock. Not necessarily true. That's what things like read locks, isolation levels and cursor stability are all about. Regards, PaulS. |