int db::Database::lock_table ( const TableId table_id,
ObjectLockMode  mode,
ObjectLockDuration  duration = DB_COMMIT_LOCK 
)

Lock a table, blocking other transactions from obtaining certain kinds of locks, depending on the selected mode.

The table is unlocked when the transaction is committed. To manually control when the lock is released, create a db::ObjectLock for table_id instead.

Parameters:
table_id Table identifier.
mode Locking mode.
duration Locking duration.
Returns:
See also:
get_table_id, ObjectLock


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