db_lock_table

  1. drupal
    1. 4.7 database.mysqli.inc
    2. 4.7
    3. 4.7 database.mysql.inc
    4. 5 database.mysqli.inc
    5. 5
    6. 5 database.mysql.inc
    7. 6 database.mysql.inc
    8. 6 database.pgsql.inc
    9. 6 database.mysqli.inc
Versions
4.7 – 6 db_lock_table($table)

Lock a table. This function automatically starts a transaction.

Related topics

▾ 3 functions call db_lock_table()

cache_set in includes/bootstrap.inc
Store data in the persistent cache.
variable_set in includes/bootstrap.inc
Set a persistent variable.
_block_rehash in modules/block.module
Update the 'blocks' DB table with the blocks currently exported by modules.

Code

includes/database.pgsql.inc, line 343

<?php
function db_lock_table($table) {
  db_query('BEGIN; LOCK TABLE {' . db_escape_table($table) . '} IN EXCLUSIVE MODE');
}
?>