changeset 599:0a4f01951fc7

Check the parents tree_modified timestamp for locking.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 08 Apr 2015 10:43:21 +0200
parents ce852671cb83
children bfec71a39c07
files src/main/java/de/intevation/lada/lock/TimestampLocker.java
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/lock/TimestampLocker.java	Wed Apr 08 10:42:09 2015 +0200
+++ b/src/main/java/de/intevation/lada/lock/TimestampLocker.java	Wed Apr 08 10:43:21 2015 +0200
@@ -67,12 +67,8 @@
                     Response mResponse =
                         repository.getById(LMessung.class, id, "land");
                     LMessung messung = (LMessung)mResponse.getData();
-                    Response pResponse =
-                        repository.getById(LProbe.class, messung.getProbeId(), "land");
-                    LProbe probe = (LProbe)pResponse.getData();
                     boolean newerMessung = isNewer(o, messung.getTreeModified());
-                    boolean newerProbe = isNewer(o, probe.getTreeModified());
-                    return newerMessung || newerProbe;
+                    return newerMessung;
                 }
             }
         }
@@ -82,7 +78,7 @@
     private boolean isNewer(Object o, Timestamp t) {
         Method m;
         try {
-            m = o.getClass().getMethod("getTreeModified");
+            m = o.getClass().getMethod("getParentModified");
             Timestamp ot = (Timestamp)m.invoke(o);
             return t.getTime() > ot.getTime();
         } catch (NoSuchMethodException | SecurityException |
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)