changeset 238:61b7041204a7

Fix for flys/issue8 (part 2) artifacts/trunk@1651 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 06 Apr 2011 21:12:58 +0000
parents 23ec48ce717e
children ab196a861796
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java
diffstat 2 files changed, 19 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Apr 06 16:49:14 2011 +0000
+++ b/ChangeLog	Wed Apr 06 21:12:58 2011 +0000
@@ -1,11 +1,19 @@
-2011-04-04	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
-
-    Possible fix for flys/issue8
-
-    * artifact-database/src/main/java/de/intevation/artifactdatabase/StringUtils.java:
-      (repeat) The term was repeated one time too often leading to invalid
-      SQL statements in database cleaner. I really should start writing 
-      unit tests.
+2011-04-06	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	Fix for flys/issue8 (part 2)
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java:
+	  PostgreSQL does not like clauses like 'NOT IN ()' so write 
+	  'NOT IN (NULL)' in these cases.
+
+2011-04-06	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	Possible fix for flys/issue8
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/StringUtils.java:
+	  (repeat) The term was repeated one time too often leading to invalid
+	  SQL statements in database cleaner. I really should start writing 
+	  unit tests.
 
 2011-04-06  Ingo Weinzierl <ingo@intevation.de>
 
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java	Wed Apr 06 16:49:14 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java	Wed Apr 06 21:12:58 2011 +0000
@@ -236,7 +236,9 @@
             ? lockedIdsProvider.getLockedIds()
             : EMPTY_IDS;
 
-        String questionMarks = StringUtils.repeat('?', lockedIds.size(), ',');
+        String questionMarks = lockedIds.isEmpty()
+            ? "NULL"
+            : StringUtils.repeat('?', lockedIds.size(), ',');
 
         try {
             connection = dataSource.getConnection();

http://dive4elements.wald.intevation.org