SQL_UPDATE_DEFAULT_SCHED_REQ_ID);
pstmt2.setInt(1, newLastTaskId);
pstmt2.executeUpdate();
}
} catch (SQLException e) {
throw new WorkspaceDatabaseException(e);
} finally {
try {
if (pstmt != null) {
pstmt.close();
}
if (pstmt2 != null) {
pstmt2.close();
}
if (rs != null) {
rs.close();
}
if (c != null) {
returnConnection(c);
}
} catch (SQLException e) {
logger.error("SQLException in finally cleanup", e);
}
}
if (lastTaskId < 0) {
throw new WorkspaceDatabaseException("lastTaskId not expected " +
"to be negative here");
}
if (newLastTaskId < 0) {
throw new WorkspaceDatabaseException("newLastTaskId not expected" +
" to be negative here");
}
if (newLastTaskId - lastTaskId != numNodes) {
throw new WorkspaceDatabaseException("difference expected to be " +
"equal to numNodes here");
}
final int[] ret = new int[numNodes];
for (int i = 0; i < numNodes; i++) {