db::ObjectLock Class Reference
[Object Ids and Locking]

#include <ittia/dbxx/dbxx_object_lock.h>

List of all members.


Detailed Description

Lock a database table or row.

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.

See also:
TableId, RowId

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)

Copyright © 2005-2008 ITTIA®. All rights reserved.