From: edward Date: Wed, 30 Mar 2016 10:25:51 +0000 (+0800) Subject: RooTrait.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=3cfcfef34f597d3cbfca83cd347a07ea16310287 RooTrait.php --- 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); + + } }