statement = connection.prepareStatement(UPDATE_SESSION_COLLECTING);
statement.setInt(1, state ? 1 : 0);
statement.setInt(2, sessionID);
if (statement.executeUpdate() == 0) {
logger.error("Cannot find session with ID " + sessionID + " to update collecting state");
throw new DBException("Cannot find session with ID " + sessionID + " to update collecting state");
}
statement.close();
logger.debug("Updating collecting state for session with ID " + sessionID + " to " + "'" + state + "'");
} catch (SQLException e) {
logger.error("Cannot update session with ID " + sessionID + " to update collecting state");
throw new DBException("Cannot update session with ID " + sessionID + " to update collecting state", e);
}
}