From 3cfcfef34f597d3cbfca83cd347a07ea16310287 Mon Sep 17 00:00:00 2001 From: edward Date: Wed, 30 Mar 2016 18:25:51 +0800 Subject: [PATCH] RooTrait.php --- RooTrait.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/RooTrait.php b/RooTrait.php index 7b4e40ad..26f0fb94 100644 --- a/RooTrait.php +++ b/RooTrait.php @@ -134,4 +134,24 @@ trait Pman_Core_RooTrait { $this->jerr($out); } + + function jok($str) + { + if ($this->transObj ) { + $this->transObj->query( connection_aborted() ? 'ROLLBACK' : 'COMMIT'); + } + + return parent::jok($str); + } + + + function jerr($str, $errors=array(), $content_type = false) + { + if ($this->transObj) { + $this->transObj->query('ROLLBACK'); + } + + return parent::jerr($str,$errors,$content_type); + + } } -- 2.39.2