CC-5109: Fix race-condition when updating cc_pref table

This commit is contained in:
Martin Konecny 2013-05-07 16:21:34 -04:00
parent ad82b4ff98
commit 9f6a1033ea
2 changed files with 19 additions and 4 deletions

View file

@ -2,9 +2,11 @@
class Application_Common_Database
{
public static function prepareAndExecute($sql, array $paramValueMap,
$type='all', $fetchType=PDO::FETCH_ASSOC)
$type='all', $fetchType=PDO::FETCH_ASSOC, $con=null)
{
$con = Propel::getConnection();
if (is_null($con)) {
$con = Propel::getConnection();
}
$stmt = $con->prepare($sql);
foreach ($paramValueMap as $param => $v) {
$stmt->bindValue($param, $v);