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

View File

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