aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/SimpleObjectManager.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-24 17:51:01 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-24 17:51:01 +0500
commit0e3c39e9d6f165c65e6156e05edc048bad9f57bc (patch)
tree8af3954fae054a33ae0d87f1425afff4d5b73ec8 /src/org/traccar/database/SimpleObjectManager.java
parent6e08953f5a482b6cecc439bd79b94c03638f77cf (diff)
downloadtrackermap-server-0e3c39e9d6f165c65e6156e05edc048bad9f57bc.tar.gz
trackermap-server-0e3c39e9d6f165c65e6156e05edc048bad9f57bc.tar.bz2
trackermap-server-0e3c39e9d6f165c65e6156e05edc048bad9f57bc.zip
Fix initial cache fill
Diffstat (limited to 'src/org/traccar/database/SimpleObjectManager.java')
-rw-r--r--src/org/traccar/database/SimpleObjectManager.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/database/SimpleObjectManager.java b/src/org/traccar/database/SimpleObjectManager.java
index 031f91fc5..0f6a9e6a4 100644
--- a/src/org/traccar/database/SimpleObjectManager.java
+++ b/src/org/traccar/database/SimpleObjectManager.java
@@ -99,7 +99,7 @@ public abstract class SimpleObjectManager {
if (items.containsKey(item.getId())) {
updateCachedItem(item);
} else {
- items.put(item.getId(), item);
+ addNewItem(item);
}
}
for (Long cachedItemId : items.keySet()) {
@@ -127,9 +127,13 @@ public abstract class SimpleObjectManager {
}
}
+ protected void addNewItem(BaseModel item) {
+ items.put(item.getId(), item);
+ }
+
public void addItem(BaseModel item) throws SQLException {
dataManager.addObject(item);
- items.put(item.getId(), item);
+ addNewItem(item);
}
protected void updateCachedItem(BaseModel item) {