diff --git a/classes/db/DBMysqlInndoDB.class.php b/classes/db/DBMysqlInndoDB.class.php index 67a535c7b..9583f78a1 100644 --- a/classes/db/DBMysqlInndoDB.class.php +++ b/classes/db/DBMysqlInndoDB.class.php @@ -113,18 +113,26 @@ * @brief 트랜잭션 시작 **/ function begin() { + if(!$this->isConnected() || $this->transaction_started) return; + $this->_query("begin"); } /** * @brief 롤백 **/ function rollback() { + if(!$this->isConnected() || !$this->transaction_started) return; + $this->_query("rollback"); + $this->transaction_started = false; } /** * @brief 커밋 **/ function commit() { + if(!$this->isConnected() || !$this->transaction_started) return; + $this->_query("commit"); + $this->transaction_started = false; } /** diff --git a/classes/db/DBSqlite3_pdo.class.php b/classes/db/DBSqlite3_pdo.class.php index e758aecc7..733d912f6 100644 --- a/classes/db/DBSqlite3_pdo.class.php +++ b/classes/db/DBSqlite3_pdo.class.php @@ -83,7 +83,7 @@ * @brief 트랜잭션 시작 **/ function begin() { - if(!$this->is_connected || $this->transaction_started) return; + if(!$this->isConnected() || $this->transaction_started) return; if($this->handler->beginTransaction()) $this->transaction_started = true; } @@ -91,7 +91,7 @@ * @brief 롤백 **/ function rollback() { - if(!$this->is_connected || !$this->transaction_started) return; + if(!$this->isConnected() || !$this->transaction_started) return; $this->handler->rollBack(); $this->transaction_started = false; } @@ -100,7 +100,7 @@ * @brief 커밋 **/ function commit() { - if(!$this->is_connected || !$this->transaction_started) return; + if(!$this->isConnected() || !$this->transaction_started) return; $this->handler->commit(); $this->transaction_started = false; }