From d57d87e6c4f8142fca1b2f173ad5818e92a5c277 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 25 Mar 2016 12:43:11 +1300 Subject: Invalidate cache on database update --- src/org/traccar/database/DataManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 419d5043c..e073f8948 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -350,12 +350,14 @@ public class DataManager implements IdentityManager { device.setId(QueryBuilder.create(dataSource, getQuery("database.insertDevice"), true) .setObject(device) .executeUpdate()); + updateDeviceCache(true); } public void updateDevice(Device device) throws SQLException { QueryBuilder.create(dataSource, getQuery("database.updateDevice")) .setObject(device) .executeUpdate(); + updateDeviceCache(true); } public void updateDeviceStatus(Device device) throws SQLException { @@ -412,12 +414,14 @@ public class DataManager implements IdentityManager { group.setId(QueryBuilder.create(dataSource, getQuery("database.insertGroup"), true) .setObject(group) .executeUpdate()); + updateGroupCache(true); } public void updateGroup(Group group) throws SQLException { QueryBuilder.create(dataSource, getQuery("database.updateGroup")) .setObject(group) .executeUpdate(); + updateGroupCache(true); } public void removeGroup(long groupId) throws SQLException { -- cgit v1.2.3