We are using Smartfox Server 2X with Jelastic cloud to host our online games. From the first time we published our game we are having some problems with the server. It seems that when we reach about 150 - 200 ccu after a while the server stops working and starts working again in about 5 minutes.
When this happens an exception gets thrown (we assume that this causes the problem) "Cannot get a connection, pool error: Could not create a validated object, cause: ValidateObject failed".
We are not sure why this happen, that's why we are asking for your help.
This is the brief code that throws this exception ("//LOGIC" parts also contains update, import and select statements, I can send you the complete function to check):
Code: Select all
Connection connection = null;
ResultSet res_select_major = null;
PreparedStatement stmt_select_major = null;
try {
connection = getParentExtension().getParentZone().getDBManager().getConnection();
stmt_select_major = connection.prepareStatement("SELECT STATEMENT");
res_select_major = stmt_select_major.executeQuery();
if (res_select_major.next()) {
// LOGIC
stmt_select_major.close();
res_select_major.close();
// LOGIC
}
// LOGIC
connection.close();
} catch (SQLException ex) {
Debugger.ShowDebug("ERROR ZONE UserHandler 1 : " + ex.getMessage() + " STACK TRACE: " + Arrays.toString(ex.getStackTrace()), ext);
} finally {
if (connection != null) {
try {
connection.close();
} catch (SQLException ex) {
}
}
if (res_select_major != null) {
try {
res_select_major.close();
} catch (SQLException ex) {
}
}
if (stmt_select_major != null) {
try {
stmt_select_major.close();
} catch (SQLException ex) {
}
}
}
Is there something wrong with this part of code?
Thank you for your time and effort!