BUG 11510 Números de casos duplicados SOLVED

- Al parecer existe un problema de concurrencia al crear los casos en processmaker, de tal forma que si se intenta crear 2 casos al mismo tiempo el número del caso termina siendo el mismo para ambos casos.
- Changed table sequence to lock read to write.
This commit is contained in:
Hector Cortez
2013-05-27 09:41:10 -04:00
parent e64c84c6ca
commit e7211f54aa
2 changed files with 18 additions and 18 deletions

View File

@@ -388,6 +388,7 @@ class Application extends BaseApplication
}
$this->setAppNumber($maxNumber);
$oSequences->changeSequence('APP_NUMBER', $maxNumber);
if ($this->validate()) {
$con->begin();
@@ -403,7 +404,6 @@ class Application extends BaseApplication
$con->commit();
$oSequences->unlockSequenceTable();
$oSequences->changeSequence('APP_NUMBER', $maxNumber);
return $this->getAppUid();
} else {
$msg = '';
@@ -412,7 +412,7 @@ class Application extends BaseApplication
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
$oSequences->unlockSequenceTable();
$oSequences->changeSequence('APP_NUMBER', $maxNumber);
throw (new PropelException('The APPLICATION row cannot be created!', new PropelException($msg)));
}
} catch (Exception $e) {

View File

@@ -80,7 +80,7 @@ class Sequences extends BaseSequences {
{
try {
$con = Propel::getConnection('workflow');
$sql = "LOCK TABLES SEQUENCES READ, APPLICATION READ ";
$sql = "LOCK TABLES SEQUENCES WRITE, APPLICATION READ ";
$stmt = $con->createStatement();
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);