Documentation Archive Developer
Search
PATH  WebObjects 4.0 Documentation > WebObjects 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 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 place a HOLDLOCK on a record. If user A tries to UPDATE the record before user B, user A blocks until user B either saveChanges or reverts . If user B attempts to saveChanges , 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 saveChanges or reverts . 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.