Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > Programming Topics

  

Pessimistic Locking in Sybase

Synopsis

Describes how pessimistic locking works in Sybase.

Discussion

All Sybase versions prior to version 11.9 use page-level locking. Unlike a row-level lock, a page-level lock not only locks the row you selected, but also locks all other rows in the same page. Page sizes can be changed, but doing so may affect overall database performance.

EOF uses the HOLDLOCK clause when performing a select to enable Sybase's pessimistic locking. Suppose two users lock a record with the HOLDLOCK clause. If user A tries to update the record before user B, user A blocks until user B either saves their changes or reverts their changes. If user B attempts to save their changes, an exception is raised and the update fails, whereupon user A's update succeeds.

Suppose user A locks a record, but user B does not. If user B attempts to update that record, they block until user A saves their changes or reverts their changes. At this point, user B's update continues, and no exception is raised.

See Also

Questions

Keywords

Revision History

22 July, 1998. Paul Haddad. First Draft.

 

© 1999 Apple Computer, Inc.