Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/org/dive4elements/artifactdatabase/DatabaseCleaner.java @ 543:e9abf747f6ce
issue1847 Remove limit and break on empty ids
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 03 Sep 2015 17:45:16 +0200 |
parents | 9497f58484a0 |
children | 266b599a4819 |
comparison
equal
deleted
inserted
replaced
542:9497f58484a0 | 543:e9abf747f6ce |
---|---|
294 result.close(); result = null; | 294 result.close(); result = null; |
295 | 295 |
296 fetchIds = conn.prepareStatement( | 296 fetchIds = conn.prepareStatement( |
297 SQL_OUTDATED.replace("$LOCKED_IDS$", questionMarks)); | 297 SQL_OUTDATED.replace("$LOCKED_IDS$", questionMarks)); |
298 | 298 |
299 // some dbms like derby do not support LIMIT | |
300 // in SQL statements. | |
301 fetchIds.setMaxRows(MAX_ROWS); | |
302 | |
303 // Fetch ids of outdated collections | 299 // Fetch ids of outdated collections |
304 stmnt = conn.prepareStatement( | 300 stmnt = conn.prepareStatement( |
305 SQL_OUTDATED_COLLECTIONS.replace( | 301 SQL_OUTDATED_COLLECTIONS.replace( |
306 "$LOCKED_IDS$", questionMarks)); | 302 "$LOCKED_IDS$", questionMarks)); |
307 | 303 |
376 if (total == 0) { | 372 if (total == 0) { |
377 break; | 373 break; |
378 } | 374 } |
379 | 375 |
380 if (ids.isEmpty()) { | 376 if (ids.isEmpty()) { |
381 continue; | 377 break; |
382 } | 378 } |
383 | 379 |
384 for (int i = ids.size()-1; i >= 0; --i) { | 380 for (int i = ids.size()-1; i >= 0; --i) { |
385 IdData idData = ids.get(i); | 381 IdData idData = ids.get(i); |
386 Artifact artifact = reviver.reviveArtifact( | 382 Artifact artifact = reviver.reviveArtifact( |