[Dive4elements-commits] [PATCH 2 of 3] AFT/DIPS: Small fixes and workarounds for Oracle DB problems

Wald Commits scm-commit at wald.intevation.org
Wed Mar 27 20:19:53 CET 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1364411949 -3600
# Node ID 7a68967ca72a6a9145397dc5bd1eb5ed3b244e61
# Parent  11fba4dabe055d3028f0c5dd2c15fbcf67ca0a58
AFT/DIPS: Small fixes and workarounds for Oracle DB problems.

diff -r 11fba4dabe05 -r 7a68967ca72a flys-aft/src/main/java/de/intevation/aft/River.java
--- a/flys-aft/src/main/java/de/intevation/aft/River.java	Wed Mar 27 18:48:28 2013 +0100
+++ b/flys-aft/src/main/java/de/intevation/aft/River.java	Wed Mar 27 20:19:09 2013 +0100
@@ -196,7 +196,7 @@
         int flysId;
 
         try {
-            if (rs.next()) {
+            if (!rs.next()) {
                 log.error(
                     "FLYS: No master discharge table found for gauge '" +
                     gauge.getAftName() + "'");
diff -r 11fba4dabe05 -r 7a68967ca72a flys-aft/src/main/java/de/intevation/db/SymbolicStatement.java
--- a/flys-aft/src/main/java/de/intevation/db/SymbolicStatement.java	Wed Mar 27 18:48:28 2013 +0100
+++ b/flys-aft/src/main/java/de/intevation/db/SymbolicStatement.java	Wed Mar 27 20:19:09 2013 +0100
@@ -143,14 +143,23 @@
         }
 
         public boolean execute() throws SQLException {
+            if (log.isDebugEnabled()) {
+                log.debug("execute: " + compiled);
+            }
             return stmnt.execute();
         }
 
         public ResultSet executeQuery() throws SQLException {
+            if (log.isDebugEnabled()) {
+                log.debug("query: " + compiled);
+            }
             return stmnt.executeQuery();
         }
 
         public int executeUpdate() throws SQLException {
+            if (log.isDebugEnabled()) {
+                log.debug("update: " + compiled);
+            }
             return stmnt.executeUpdate();
         }
 
diff -r 11fba4dabe05 -r 7a68967ca72a flys-aft/src/main/resources/sql/aft-common.properties
--- a/flys-aft/src/main/resources/sql/aft-common.properties	Wed Mar 27 18:48:28 2013 +0100
+++ b/flys-aft/src/main/resources/sql/aft-common.properties	Wed Mar 27 20:19:09 2013 +0100
@@ -17,9 +17,9 @@
     SELECT TAFELWERT_NR AS id, WASSERSTAND AS w, ABFLUSS AS q FROM TAFELWERT \
     WHERE ABFLUSSTAFEL_NR = :number
 select.bfg.id.current = \
-    SELECT BFG_ID AS BFG_ID FROM ABFLUSSTAFEL \
+    SELECT ABT.BFG_ID AS BFG_ID FROM ABFLUSSTAFEL ABT \
     WHERE GUELTIG_VON IN ( \
         SELECT min(GUELTIG_VON) FROM ABFLUSSTAFEL \
         WHERE GUELTIG_VON IS NOT NULL AND GUELTIG_BIS IS NULL \
         AND MESSSTELLE_NR LIKE :number) \
-    AND MESSSTELLE_NR :number
+    AND MESSSTELLE_NR LIKE :number
diff -r 11fba4dabe05 -r 7a68967ca72a flys-aft/src/main/resources/sql/aft-oracle-jdbc-oracledriver.properties
--- a/flys-aft/src/main/resources/sql/aft-oracle-jdbc-oracledriver.properties	Wed Mar 27 18:48:28 2013 +0100
+++ b/flys-aft/src/main/resources/sql/aft-oracle-jdbc-oracledriver.properties	Wed Mar 27 20:19:09 2013 +0100
@@ -4,6 +4,6 @@
            GUELTIG_VON, \
            GUELTIG_BIS, \
            PEGELNULLPUNKT, \
-           BFG_ID \
-    FROM ABFLUSSTAFEL \
+           AT.BFG_ID \
+    FROM ABFLUSSTAFEL AT \
     WHERE MESSSTELLE_NR LIKE :number


More information about the Dive4elements-commits mailing list