Is there a node hook that runs AFTER a node is fully inserted into the database? I want to run some code after a node is inserted into the database.  hook_node_insert() is close, of course, but as the doc says, "when this hook is invoked, the changes have not yet been written to the database, because a database transaction is still in progress".  Is there a hook that I can implement that give me access to the newly-inserted node after it's completely in the database?  hook_path_insert() does this, and is related to what I want to do, but it's not optimal for all sorts of reasons.  Thoughts?
There isn't a hook that is called after the transaction is completed, as the code node_save() executes is executed during the transaction.

function node_save($node) {
  $transaction = db_transaction();

  try {

    // ...

  }
  catch (Exception $e) {
    $transaction-&gt;rollback();
    watchdog_exception('node', $e);
    throw $e;
  }
}


If node_save() is called from node_form_submit() (the form submission handler for the node form), you can add a form submission handler that is called after that. It would be executed after the node is saved in the database.

What the documentation for hook_node_insert() means is that, since the data are not still saved in the database table, you cannot query a table making a join with the "node" table, as that table still contains the old data; in the same way, you should not call a function that queries the "node" table.