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:
@@ -525,18 +525,29 @@ class workspaceTools
|
|||||||
$oCriteria->add(ConfigurationPeer::OBJ_UID, array("todo", "draft", "sent", "unassigned", "paused", "cancelled"), Criteria::NOT_IN);
|
$oCriteria->add(ConfigurationPeer::OBJ_UID, array("todo", "draft", "sent", "unassigned", "paused", "cancelled"), Criteria::NOT_IN);
|
||||||
ConfigurationPeer::doDelete($oCriteria);
|
ConfigurationPeer::doDelete($oCriteria);
|
||||||
// end of reset
|
// end of reset
|
||||||
|
|
||||||
//close connection
|
//close connection
|
||||||
$connection = Propel::getConnection( 'workflow' );
|
$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();
|
$sql_sleep = "SELECT * FROM information_schema.processlist WHERE command = 'Sleep' and user = SUBSTRING_INDEX(USER(),'@',1) and db = DATABASE() ORDER BY id;";
|
||||||
$rs = $stmt->executeQuery( $sql, ResultSet::FETCHMODE_ASSOC );
|
$stmt_sleep = $connection->createStatement();
|
||||||
while ($rs->next()) {
|
$rs_sleep = $stmt_sleep->executeQuery( $sql_sleep, ResultSet::FETCHMODE_ASSOC );
|
||||||
$row = $rs->getRow();
|
|
||||||
$oStatement = $connection->prepareStatement( "kill ". $row['ID'] );
|
while ($rs_sleep->next()) {
|
||||||
$oStatement->executeQuery();
|
$row_sleep = $rs_sleep->getRow();
|
||||||
|
$oStatement_sleep = $connection->prepareStatement( "kill ". $row_sleep['ID'] );
|
||||||
|
$oStatement_sleep->executeQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql_query = "SELECT * FROM information_schema.processlist WHERE user = SUBSTRING_INDEX(USER(),'@',1) and db = DATABASE() ORDER BY id;";
|
||||||
|
$stmt_query = $connection->createStatement();
|
||||||
|
$rs_query = $stmt_query->executeQuery( $sql_query, ResultSet::FETCHMODE_ASSOC );
|
||||||
|
|
||||||
|
while ($rs_query->next()) {
|
||||||
|
$row_query = $rs_query->getRow();
|
||||||
|
$oStatement_query = $connection->prepareStatement( "kill ". $row_query['ID'] );
|
||||||
|
$oStatement_query->executeQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user