Skip to content

Instantly share code, notes, and snippets.

@kawahara
Created April 2, 2010 18:34
Show Gist options
  • Save kawahara/353516 to your computer and use it in GitHub Desktop.
Save kawahara/353516 to your computer and use it in GitHub Desktop.
<?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