spec_transaction_with_transaction | R Documentation |
spec_transaction_with_transaction
dbWithTransaction()
returns the value of the executed code.
Failure to initiate the transaction
(e.g., if the connection is closed
or invalid
of if dbBegin()
has been called already)
gives an error.
dbWithTransaction()
initiates a transaction with dbBegin()
, executes
the code given in the code
argument, and commits the transaction with
dbCommit()
.
If the code raises an error, the transaction is instead aborted with
dbRollback()
, and the error is propagated.
If the code calls dbBreak()
, execution of the code stops and the
transaction is silently aborted.
All side effects caused by the code
(such as the creation of new variables)
propagate to the calling environment.
Other transaction specifications:
spec_transaction_begin_commit_rollback
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.