propelorm/sfPropelORMPlugin — pull request #150 by lcallarec (2012-07-10 20:40:01+00:00)
Title: Fixed inconsistancy in the use of $con parameters inside sfPropelFormGeneratedTemplate

Hi,

When using symfony propel:build-forms, sfPropelFormGeneratedTemplate class is used as a template for building BaseXXXForms.

Inside the saveXXXList() method : $con attribute is passed as a parameter to XXXPeer::doDelete() method, whereas it's not the case for $obj->save() method.

In multiple database connection environment, this issue can lock tables. In my case : the doDelete() method is using connection 1. Rows are deleted, but no commit is done yet. After that, the $obj->save() method use the connection 2, as set in its base Peer class. But, the INSERT query sent had to wait the end of connection 2 transaction (no matter, commit or rollback).

In this case, all tables impacted by a DML query through connection 1 or 2 will be locked. The best thing you have to do then : killing the blocking session.

This issue was revealed with an Oracle database behind, but will certainly affects all others rdbms, including MySQL / InnoDB.