diff --git a/lib/Doctrine/Db.php b/lib/Doctrine/Db.php index 2e9676fb9..20a515fc5 100644 --- a/lib/Doctrine/Db.php +++ b/lib/Doctrine/Db.php @@ -422,6 +422,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte */ public function beginTransaction() { + $this->connect(); + $event = new Doctrine_Db_Event($this, Doctrine_Db_Event::BEGIN); $this->listener->onPreBeginTransaction($event); @@ -439,6 +441,8 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte */ public function commit() { + $this->connect(); + $event = new Doctrine_Db_Event($this, Doctrine_Db_Event::COMMIT); $this->listener->onPreCommit($event);