creoleのバグ
具体的にいうとMySQLのドライバの下記のあたり
/** * Roll back (undo) the current transaction. * @throws SQLException * @return void */ protected function rollbackTrans() { if ($this->database) { if (!@mysql_select_db($this->database, $this->dblink)) { throw new SQLException('No database selected', mysql_error($this->dblink)); } } $result = @mysql_query('ROLLBACK', $this->dblink); $result = @mysql_query('SET AUTOCOMMIT=1', $this->dblink); if (!$result) { throw new SQLException('Could not rollback transaction', mysql_error($this->dblink)); } }
「$result = @mysql_query('ROLLBACK', $this->dblink);」
この結果をチェックしてないので、ROLLBACK失敗時に"SET AUTOCOMMIT=1"をするため暗黙のcommitが働き、結果commitされてしまう。
もし、今だPropelの古いバージョンなどを使ってる人がいたらこの周辺のコードはパッチあてたほうがいい。
/** * Roll back (undo) the current transaction. * @throws SQLException * @return void */ protected function rollbackTrans() { if ($this->database) { if (!@mysql_select_db($this->database, $this->dblink)) { throw new SQLException('No database selected', mysql_error($this->dblink)); } } $result = @mysql_query('ROLLBACK', $this->dblink); if (!$result) { throw new SQLException('Could not rollback transaction', mysql_error($this->dblink)); } $result = @mysql_query('SET AUTOCOMMIT=1', $this->dblink); if (!$result) { throw new SQLException('Could not rollback transaction', mysql_error($this->dblink)); } }
こんな極東のブログで日本語だけでかかずに、バグ報告したいのだが、creoleプロジェクトは終了したプロジェクトなので悩んだ挙句ここにさらすだけにとどめておく。