[Lada-commits] [PATCH 3 of 6] Check the parents tree_modified timestamp for locking
Wald Commits
scm-commit at wald.intevation.org
Wed Apr 8 10:45:41 CEST 2015
# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1428482601 -7200
# Node ID 0a4f01951fc7bebbcb56a6c5dd23a3d76ed1f58e
# Parent ce852671cb8328bb3ce150d76eef198069e5aa6c
Check the parents tree_modified timestamp for locking.
diff -r ce852671cb83 -r 0a4f01951fc7 src/main/java/de/intevation/lada/lock/TimestampLocker.java
--- 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 |
More information about the Lada-commits
mailing list