Simplify OC_DB transaction functions
This commit is contained in:
parent
eed63ae512
commit
fd317f599b
10
lib/db.php
10
lib/db.php
|
@ -56,7 +56,6 @@ class OC_DB {
|
|||
*/
|
||||
static private $DOCTRINE=null;
|
||||
|
||||
static private $inTransaction=false;
|
||||
static private $prefix=null;
|
||||
static private $type=null;
|
||||
|
||||
|
@ -624,27 +623,18 @@ class OC_DB {
|
|||
|
||||
/**
|
||||
* Start a transaction
|
||||
* @return bool
|
||||
*/
|
||||
public static function beginTransaction() {
|
||||
self::connect();
|
||||
self::$connection->beginTransaction();
|
||||
self::$inTransaction=true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Commit the database changes done during a transaction that is in progress
|
||||
* @return bool
|
||||
*/
|
||||
public static function commit() {
|
||||
self::connect();
|
||||
if(!self::$inTransaction) {
|
||||
return false;
|
||||
}
|
||||
self::$connection->commit();
|
||||
self::$inTransaction=false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue