Skip to content

Commit b8bf847

Browse files
committed
fix bug
1 parent eb86a4b commit b8bf847

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Transaction.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function start($transactionOptions = []){
5757
if($this->clientSession->mongoSession->isInTransaction())
5858
throw new Exception('Nested transaction not supported');
5959
$this->clientSession->db->trigger(Connection::EVENT_START_TRANSACTION);
60-
if($this->mongoSession->db->enableLogging)
60+
if($this->clientSession->mongoSession->db->enableLogging)
6161
Yii::beginProfile('mongodb > start transaction(session id => '.$this->clientSession->getId().')');
6262
$this->clientSession->mongoSession->startTransaction($transactionOptions);
6363
Yii::debug('MongoDB transaction started.', __METHOD__);
@@ -70,7 +70,7 @@ public function start($transactionOptions = []){
7070
public function commit(){
7171
Yii::debug('Committing mongodb transaction ...', __METHOD__);
7272
$this->clientSession->mongoSession->commitTransaction();
73-
if($this->mongoSession->db->enableLogging)
73+
if($this->clientSession->mongoSession->db->enableLogging)
7474
Yii::endProfile('mongodb > start transaction(session id => '.$this->clientSession->getId().')');
7575
Yii::debug('Commit mongodb transaction.', __METHOD__);
7676
$this->clientSession->db->trigger(Connection::EVENT_COMMIT_TRANSACTION);
@@ -83,7 +83,7 @@ public function commit(){
8383
public function rollBack(){
8484
Yii::debug('Rolling back mongodb transaction ...', __METHOD__);
8585
$this->clientSession->mongoSession->abortTransaction();
86-
if($this->mongoSession->db->enableLogging)
86+
if($this->clientSession->mongoSession->db->enableLogging)
8787
Yii::endProfile('mongodb > start transaction(session id => '.$this->clientSession->getId().')');
8888
Yii::debug('Roll back mongodb transaction.', __METHOD__);
8989
$this->clientSession->db->trigger(Connection::EVENT_ROLLBACK_TRANSACTION);

0 commit comments

Comments
 (0)