Locking
[Transactions, Locking and Logging]

Collaboration diagram for Locking:


Functions

static concurrency_t ss_m::xct_lock_level ()
 Get the locking granularity for the attached transaction.
static void ss_m::set_xct_lock_level (concurrency_t l)
 Set the default locking level for the attached transaction.
static rc_t ss_m::lock (const lockid_t &n, lock_mode_t m, lock_duration_t d=t_long, timeout_in_ms timeout=WAIT_SPECIFIED_BY_XCT)
 Acquire a lock.
static rc_t ss_m::unlock (const lockid_t &n)
 Release a lock.
static rc_t ss_m::dont_escalate (const lockid_t &n, bool passOnToDescendants=true)
 Disable lock escalation on the given entity.
static rc_t ss_m::get_escalation_thresholds (w_base_t::int4_t &toPage, w_base_t::int4_t &toStore, w_base_t::int4_t &toVolume)
 Find the storage-manager-wide escalation thresholds

Default values (used for all transactions until they change their per-transaction thresholds) are determined by the storage-manager-wide options. See List of Run-Time Options.

static rc_t ss_m::set_escalation_thresholds (w_base_t::int4_t toPage, w_base_t::int4_t toStore, w_base_t::int4_t toVolume)
 Change the storage-manager-wide escalation thresholds

Default values (used for all transactions until they change their per-transaction thresholds) are determined by the storage-manager-wide options. See List of Run-Time Options.

static rc_t ss_m::query_lock (const lockid_t &n, lock_mode_t &m, bool implicit=false)
 Find out if the attached transaction has an entity locked.
static rc_t ss_m::set_lock_cache_enable (bool enable)
 Control lock caching for attached transaction.
static rc_t ss_m::lock_cache_enabled (bool &enabled)
 True if lock cache is enabled for the attached transaction.


Function Documentation

static void ss_m::set_xct_lock_level ( concurrency_t  l  )  [static, inherited]

Set the default locking level for the attached transaction.

Parameters:
[in] l The level to use for the balance of this transaction. Legitimate values are t_cc_record, t_cc_page, t_cc_file.
Note:
Only one thread may be attached to the transaction when this is called. If more than one thread is attached, a fatal error will ensue.

static rc_t ss_m::lock ( const lockid_t n,
lock_mode_t  m,
lock_duration_t  d = t_long,
timeout_in_ms  timeout = WAIT_SPECIFIED_BY_XCT 
) [static, inherited]

Acquire a lock.

Parameters:
[in] n Lock id of the entity to lock. There are conversions from record ids, volume ids, store ids, and page ids to lockid_t.
[in] m Desired lock mode. Values: EX, SH.
[in] d Desired duration. Values:
  • t_very_long : Held across transaction boundaries; cannot be released by unlock()
  • t_long : Released at commit; cannot be released by unlock()
  • t_medium : May be released early by explicit unlock()
  • t_short : May be released early by explicit unlock()
  • t_instant : Not held: acquired and released immediately. Useful to see if any other transaction holds an incompatible lock.
[in] timeout Milliseconds willing to block. See timeout_in_ms.
The lock manager is written with these durations in mind, but the only durations used by the storage manager are t_instant and t_long. Medium-duration locks are used internally in a one place.

Durations other than long and instant are not well-tested.

static rc_t ss_m::unlock ( const lockid_t n  )  [static, inherited]

Release a lock.

Parameters:
[in] n Lock id of the entity to lock. There are conversions from record ids, volume ids, store ids, and page ids to lockid_t.

static rc_t ss_m::dont_escalate ( const lockid_t n,
bool  passOnToDescendants = true 
) [static, inherited]

Disable lock escalation on the given entity.

Parameters:
[in] n Lock id of the entity to lock. There are conversions from record ids, volume ids, store ids, and page ids to lockid_t.
[in] passOnToDescendants If true, apply this to the descendants of n.

static rc_t ss_m::query_lock ( const lockid_t n,
lock_mode_t &  m,
bool  implicit = false 
) [static, inherited]

Find out if the attached transaction has an entity locked.

Parameters:
[in] n Lock id of the entity to lock. There are conversions from record ids, volume ids, store ids, and page ids to lockid_t.
[out] m Mode of lock held. NL if none.
[in] implicit If "true" the query will returns a lock mode if an implicit lock is held, otherwise the lock must be held explicitly.

static rc_t ss_m::set_lock_cache_enable ( bool  enable  )  [static, inherited]

Control lock caching for attached transaction.

Parameters:
[in] enable Set to true if you want to turn on lock caching for the attached transaction. The default is that it is turned on.
Only long-duration locks are cached. Lock caching can be turned off by default using the sm_lock_caching option. Even with it turned off by default, it can be turned on for a given transcation with this method.

static rc_t ss_m::lock_cache_enabled ( bool &  enabled  )  [static, inherited]

True if lock cache is enabled for the attached transaction.

Parameters:
[out] enabled Will be set to true if the attached transaction has lock caching enabled, false otherwise.


Generated on Wed Jul 7 17:22:37 2010 for Shore Storage Manager by  doxygen 1.4.7