db_transaction

  1. drupal
    1. 7
Versions
7 db_transaction($name = NULL, array $options = array())

Returns a new transaction object for the active database.

Parameters

string $name Optional name of the transaction.

array $options An array of options to control how the transaction operates:

  • target: The database target name.

Return value

DatabaseTransaction A new DatabaseTransaction object for this connection.

Related topics

▾ 12 functions call db_transaction()

block_admin_configure_submit in drupal/modules/block/block.admin.inc
Form submission handler for the block configuration form.
block_admin_display_form_submit in drupal/modules/block/block.admin.inc
Form submission handler for the main blocks administration form.
comment_delete_multiple in drupal/modules/comment/comment.module
Delete comments and all their replies.
comment_save in drupal/modules/comment/comment.module
Accepts a submission of new or changed comment content.
menu_rebuild in drupal/includes/menu.inc
(Re)populate the database tables used by various menu functions.
node_delete_multiple in drupal/modules/node/node.module
Delete multiple nodes.
node_save in drupal/modules/node/node.module
Save changes to a node or add a new node.
taxonomy_term_delete in drupal/modules/taxonomy/taxonomy.module
Delete a term.
taxonomy_vocabulary_delete in drupal/modules/taxonomy/taxonomy.module
Delete a vocabulary.
user_delete_multiple in drupal/modules/user/user.module
Delete multiple user accounts.
user_save in drupal/modules/user/user.module
Save changes to a user account or add a new user.
_registry_update in drupal/includes/registry.inc
Does the work for registry_update().

Code

drupal/includes/database/database.inc, line 2406

<?php
function db_transaction($name = NULL, array $options = array()) {
  if (empty($options['target'])) {
    $options['target'] = 'default';
  }
  return Database::getConnection($options['target'])->startTransaction($name);
}
?>