DbEnv::lock_get API Ref

#include <db_cxx.h>

int DbEnv::lock_get(u_int32_t locker, u_int32_t flags, const Dbt *object, const db_lockmode_t lock_mode, DbLock *lock);


Description: DbEnv::lock_get

The DbEnv::lock_get method acquires a lock from the lock table, returning information about it in the lock parameter.

The DbEnv::lock_get method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters
flags lock_mode locker object

Errors

The DbEnv::lock_get method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:


EINVAL

If a transactional database environment operation was selected to resolve a deadlock, the DbEnv::lock_get method will fail and either return DB_LOCK_DEADLOCK or throw a DbDeadlockException exception.

If a Berkeley DB Concurrent Data Store database environment configured for lock timeouts was unable to grant a lock in the allowed time, the DbEnv::lock_get method will fail and either return DB_LOCK_NOTGRANTED or throw a DbLockNotGrantedException exception.

If the DB_LOCK_NOWAIT flag or lock timers were configured and the lock could not be granted before the wait-time expired, the DbEnv::lock_get method will fail and either return DB_LOCK_NOTGRANTED or throw a DbLockNotGrantedException exception.

If the maximum number of locks has been reached, the DbEnv::lock_get method will fail and either return ENOMEM or throw a DbMemoryException.



Class DbEnv, DbLock
See Also Locking Subsystem and Related Methods

APIRef

Copyright (c) 1996,2008 Oracle. All rights reserved.