try {\r
Thread.sleep(1000L);\r
} catch (InterruptedException e) {\r
+ Thread.currentThread().interrupt();\r
}\r
idle = false;\r
} else {\r
Connection conn = null;\r
try {\r
conn = db.getConnection();\r
- Statement stmt = conn.createStatement();\r
- // Build a bitset of all records in the LOG_RECORDS table\r
- // We need to run this SELECT in stages, because otherwise we run out of memory!\r
RLEBitSet nbs = new RLEBitSet();\r
- final long stepsize = 6000000L;\r
- boolean go_again = true;\r
- for (long i = 0; go_again; i += stepsize) {\r
- String sql = String.format("select RECORD_ID from LOG_RECORDS LIMIT %d,%d", i, stepsize);\r
- try(ResultSet rs = stmt.executeQuery(sql)) {\r
- go_again = false;\r
- while (rs.next()) {\r
- long n = rs.getLong("RECORD_ID");\r
- nbs.set(n);\r
- go_again = true;\r
+ try(Statement stmt = conn.createStatement()) {\r
+ // Build a bitset of all records in the LOG_RECORDS table\r
+ // We need to run this SELECT in stages, because otherwise we run out of memory!\r
+ final long stepsize = 6000000L;\r
+ boolean go_again = true;\r
+ for (long i = 0; go_again; i += stepsize) {\r
+ String sql = String.format("select RECORD_ID from LOG_RECORDS LIMIT %d,%d", i, stepsize);\r
+ try (ResultSet rs = stmt.executeQuery(sql)) {\r
+ go_again = false;\r
+ while (rs.next()) {\r
+ long n = rs.getLong("RECORD_ID");\r
+ nbs.set(n);\r
+ go_again = true;\r
+ }\r
}\r
}\r
}\r
- stmt.close();\r
seq_set = nbs;\r
-\r
// Compare with the range for this server\r
// Determine the next ID for this set of record IDs\r
RLEBitSet tbs = (RLEBitSet) nbs.clone();\r