From 2f602068573a486e163777a18f118a4682420fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Wed, 8 Jun 2016 16:05:40 +0200 Subject: [PATCH] remove dupe - Remove redundant declaration of transaction methods (#110, @@bborgesr). --- R/DBConnection.R | 47 --------------------------------------------- man/transactions.Rd | 28 +-------------------------- 2 files changed, 1 insertion(+), 74 deletions(-) diff --git a/R/DBConnection.R b/R/DBConnection.R index 686f781b5..36d4f9a0f 100644 --- a/R/DBConnection.R +++ b/R/DBConnection.R @@ -311,50 +311,3 @@ setGeneric("dbRemoveTable", def = function(conn, name, ...) standardGeneric("dbRemoveTable"), valueClass = "logical" ) - -#' Begin/commit/rollback SQL transactions -#' -#' Not all database engines implement transaction management, in which case -#' these methods should not be implemented for the specific -#' \code{\linkS4class{DBIConnection}} subclass. -#' -#' @section Side Effects: -#' The current transaction on the connections \code{con} is committed or rolled -#' back. -#' -#' @inheritParams dbDisconnect -#' @return a logical indicating whether the operation succeeded or not. -#' @examples -#' \dontrun{ -#' ora <- dbDriver("Oracle") -#' con <- dbConnect(ora) -#' rs <- dbSendQuery(con, -#' "delete * from PURGE as p where p.wavelength<0.03") -#' if(dbGetInfo(rs, what = "rowsAffected") > 250){ -#' warning("dubious deletion -- rolling back transaction") -#' dbRollback(con) -#' } -#' } -#' @name transactions -NULL - -#' @export -#' @rdname transactions -setGeneric("dbBegin", - def = function(conn, ...) standardGeneric("dbBegin"), - valueClass = "logical" -) - -#' @export -#' @rdname transactions -setGeneric("dbCommit", - def = function(conn, ...) standardGeneric("dbCommit"), - valueClass = "logical" -) - -#' @export -#' @rdname transactions -setGeneric("dbRollback", - def = function(conn, ...) standardGeneric("dbRollback"), - valueClass = "logical" -) diff --git a/man/transactions.Rd b/man/transactions.Rd index e9ef3ad5e..13a93fbc9 100644 --- a/man/transactions.Rd +++ b/man/transactions.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/DBConnection.R, R/transactions.R +% Please edit documentation in R/transactions.R \name{transactions} \alias{dbBegin} \alias{dbCommit} @@ -11,12 +11,6 @@ dbBegin(conn, ...) dbCommit(conn, ...) -dbRollback(conn, ...) - -dbBegin(conn, ...) - -dbCommit(conn, ...) - dbRollback(conn, ...) } \arguments{ @@ -26,25 +20,15 @@ dbRollback(conn, ...) \item{...}{Other parameters passed on to methods.} } \value{ -a logical indicating whether the operation succeeded or not. - a logical indicating whether the operation succeeded or not. } \description{ -Not all database engines implement transaction management, in which case -these methods should not be implemented for the specific -\code{\linkS4class{DBIConnection}} subclass. - Not all database engines implement transaction management, in which case these methods should not be implemented for the specific \code{\linkS4class{DBIConnection}} subclass. } \section{Side Effects}{ -The current transaction on the connections \code{con} is committed or rolled -back. - - The current transaction on the connections \code{con} is committed or rolled back. } @@ -59,15 +43,5 @@ if(dbGetInfo(rs, what = "rowsAffected") > 250){ dbRollback(con) } } -\dontrun{ -ora <- dbDriver("Oracle") -con <- dbConnect(ora) -rs <- dbSendQuery(con, - "delete * from PURGE as p where p.wavelength<0.03") -if(dbGetInfo(rs, what = "rowsAffected") > 250){ - warning("dubious deletion -- rolling back transaction") - dbRollback(con) -} -} }