Created
April 2, 2010 18:34
-
-
Save kawahara/353516 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class opDoctrineConnectionOpenPNE extends Doctrine_Connection_Mysql | |
{ | |
protected function unsetDbh() | |
{ | |
if (!$this->transaction->getTransactionLevel()) | |
{ | |
$this->dbh = null; | |
$this->isConnected = false; | |
} | |
} | |
public function execute($query, array $params = array()) | |
{ | |
$stmt = parent::execute($query, $params); | |
$this->unsetDbh(); | |
return $stmt; | |
} | |
public function commit($savepoint = null) | |
{ | |
$result = parent::commit($savepoint); | |
$this->unsetDbh(); | |
return $result; | |
} | |
public function rollback($savepoint = null) | |
{ | |
$result = parent::rollback($savepoint); | |
$this->unsetDbh(); | |
return $result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment