#include <ittia/dbxx/dbxx_object_lock.h>
Use lock or try_lock to lock the object. The lock is released when the ObjectLock object is destroyed, or when unlock is called explicitly.
Each ObjectLock instance can lock one table or row at a time. If a database object is already locked when a new lock is requested, the first lock is released after the new lock is granted.
Public Member Functions | |
| ObjectLock (const ObjectId &) | |
| int | lock (ObjectLockMode, ObjectLockDuration=DB_COMMIT_LOCK) |
| int | try_lock (ObjectLockMode, ObjectLockDuration=DB_COMMIT_LOCK) |
| int | lock (const ObjectId &, ObjectLockMode, ObjectLockDuration=DB_COMMIT_LOCK) |
| int | try_lock (const ObjectId &, ObjectLockMode, ObjectLockDuration=DB_COMMIT_LOCK) |
| int | unlock () |
| bool | is_locked () const |
| const ObjectId & | _get_object_id () const |
Static Public Member Functions | |
| static db_hlock_t | _lock (const ObjectId &, ObjectLockMode, ObjectLockDuration, bool trylock) |