BUG UPGRADE MORE THAN 160 WS.

When you try to upgrade more than 160 ws in a single PM instalation a TO MANY CONNECTIONS ERROR happens, and this stop the ws upgrade.

When you make the upgrade of many ws, each ws opens a new connection to the DB, and this is closed only at the end of all ws upgrade, so this cause the TO MANY CONNECTIONS error.

To solve the problem I kill the connection to the DB at the end of each ws upgrade.
This commit is contained in:
jennylee
2014-07-28 09:50:40 -04:00
parent 587e491459
commit f2df12faec

View File

@@ -525,6 +525,18 @@ class workspaceTools
$oCriteria->add(ConfigurationPeer::OBJ_UID, array("todo", "draft", "sent", "unassigned", "paused", "cancelled"), Criteria::NOT_IN);
ConfigurationPeer::doDelete($oCriteria);
// end of reset
//close connection
$connection = Propel::getConnection( 'workflow' );
$sql = "SELECT * FROM information_schema.processlist WHERE user = SUBSTRING_INDEX(USER(),'@',1) and db = DATABASE() ORDER BY id;";
$stmt = $connection->createStatement();
$rs = $stmt->executeQuery( $sql, ResultSet::FETCHMODE_ASSOC );
while ($rs->next()) {
$row = $rs->getRow();
$oStatement = $connection->prepareStatement( "kill ". $row['ID'] );
$oStatement->executeQuery();
}
}
/**