Chapter 5 C Routines Reference
Lock a collection.
JagStatus JagLockCollection (
JagDataCollection * pCollection)
pCollection
The handle of the collection.
Return value |
To indicate |
---|---|
JAG_SUCCEED |
Success |
JAG_FAIL |
Failure |
JagLockCollection fails if the collection's isolation mode is JAG_LOCKDATA.
Check the server's log file for more information when JagLockCollection fails.
Locking a collection is strictly advisory. Even though a collection is locked, the JagGetSharedValue and JagSetSharedValue methods can still read and update the shared variables in the collection. If the collection is locked, JagLockCollection waits until the lock is released. To ensure that multiple read and update operations on any shared variable in a collection is atomic, lock the collection before executing read or update operations on the shared variables in the collection.
The JagLockCollection method prevents other JagLockCollection and JagLockNoWaitCollection requests from locking the collection until the lock is released. If the lock is successful, JAG_SUCCEED is returned. If the collection has already been locked by the calling object, this method does not lock the collection and JAG_SUCCEED is returned.
See "Share Data Between C Components" in the Jaguar CTS Programmer's Guide for more information.
JagGetSharedValue, JagLockNoWaitCollection, JagSetSharedValue, JagUnlockCollection
Copyright © 2000 Sybase, Inc. All rights reserved. |
![]() |