BUG 000 BUG 000 momentarily reverted to rc5 for pmTables (Win env compatibility

+ fixes for a unused transaction
This commit is contained in:
Erik Amaru Ortiz
2011-09-06 13:07:03 -04:00
parent 10b98b0285
commit e9296320dc

View File

@@ -549,31 +549,24 @@ class pmTablesProxy extends HttpProxyController
eval('$obj = new ' .$this->className. '();');
if (count($row) > 0) {
try {
eval('$con = Propel::getConnection('.$this->classPeerName.'::DATABASE_NAME);');
$con->begin();
$obj->fromArray($row, BasePeer::TYPE_FIELDNAME);
eval('$con = Propel::getConnection('.$this->classPeerName.'::DATABASE_NAME);');
$obj->fromArray($row, BasePeer::TYPE_FIELDNAME);
if ($obj->validate()) {
$obj->save();
$toSave = true;
$primaryKeysValues = array();
foreach ($primaryKeys as $primaryKey) {
$method = 'get' . AdditionalTables::getPHPName($primaryKey['FLD_NAME']);
$primaryKeysValues[] = $obj->$method();
}
if ($obj->validate()) {
$obj->save();
$toSave = true;
$primaryKeysValues = array();
foreach ($primaryKeys as $primaryKey) {
$method = 'get' . AdditionalTables::getPHPName($primaryKey['FLD_NAME']);
$primaryKeysValues[] = $obj->$method();
}
else {
foreach($obj->getValidationFailures() as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "\n";
}
throw new PropelException($msg);
}
else {
foreach($obj->getValidationFailures() as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "\n";
}
}
catch(Exception $e) {
$con->rollback();
throw new Exception($e->getMessage());
throw new PropelException($msg);
}
$index = G::encrypt(implode('-', $primaryKeysValues), 'pmtable');
}