dbTransaction: DB Transaction

View source: R/compound_db.R

dbTransactionR Documentation

DB Transaction

Description

Run any db statements inside a transaction. If any error is raised the transaction will be rolled back, otherwise it will be committed at the end.

Usage

dbTransaction(conn, expr)

Arguments

conn

A database connection object, such as is returned by initDb.

expr

Any block of code.

Value

The value of the given block of code will be returned upon successfully commiting the transaction. Otherwise an error will be raised.

Author(s)

Kevin Horan

Examples

	
   conn = initDb("test15.db")
	dbTransaction(conn,{
		# any db code here
	})

girke-lab/ChemmineR documentation built on July 28, 2023, 10:36 a.m.