Merged in victorsl/processmaker/PM-1903 (pull request #1827)

PM-1903 "0017014: ProcessMaker loses connection..." SOLVED
This commit is contained in:
Julio Cesar Laura Avendaño
2015-04-06 23:37:45 -04:00
4 changed files with 50 additions and 13 deletions

View File

@@ -596,16 +596,20 @@ class Propel {
* *
* @return void * @return void
*/ */
public static function close() public static function close()
{ {
$last = ''; $lastQuery = "";
foreach(self::$connectionMap as $conn) {
if ($last != $conn->lastQuery) { foreach (self::$connectionMap as $cnn) {
$conn->close(); if (!($cnn instanceof DBArrayConnection)) {
} if (gettype($cnn->getResource()) == "resource" && $cnn->isConnected() && $cnn->lastQuery != $lastQuery) {
$last = $conn->lastQuery; $cnn->close();
} }
}
$lastQuery = $cnn->lastQuery;
}
}
}
/** /**
* @param $name string The connection name * @param $name string The connection name

View File

@@ -1,4 +1,15 @@
<?php <?php
register_shutdown_function(
create_function(
"",
"
if (class_exists(\"Propel\")) {
Propel::close();
}
"
)
);
/** /**
* cron_single.php * cron_single.php
* @package workflow-engine-bin * @package workflow-engine-bin

View File

@@ -1,4 +1,15 @@
<?php <?php
register_shutdown_function(
create_function(
"",
"
if (class_exists(\"Propel\")) {
Propel::close();
}
"
)
);
ini_set("memory_limit", "512M"); ini_set("memory_limit", "512M");
try { try {

View File

@@ -1,4 +1,15 @@
<?php <?php
register_shutdown_function(
create_function(
"",
"
if (class_exists(\"Propel\")) {
Propel::close();
}
"
)
);
/* /*
* ProcessMaker Web Application Bootstrap * ProcessMaker Web Application Bootstrap
*/ */