diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-04-16 22:35:52 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-04-16 22:35:52 +1200 |
commit | b0cc82537c309ffd9295d9b9ea2f0ea190bae3ba (patch) | |
tree | 37cca4ace09d3056c9b4a8a4dfbebbd084f07f6c /src/org/traccar/web/server/model/DataServiceImpl.java | |
parent | 6cd8c5548b0e6934e8b9b72a8a703f9541dd8c99 (diff) | |
parent | c5c60d7262e774eeb3314d5af5a432b26c8210cf (diff) | |
download | trackermap-web-b0cc82537c309ffd9295d9b9ea2f0ea190bae3ba.tar.gz trackermap-web-b0cc82537c309ffd9295d9b9ea2f0ea190bae3ba.tar.bz2 trackermap-web-b0cc82537c309ffd9295d9b9ea2f0ea190bae3ba.zip |
Merge pull request #167 from khfayzullaev/patch-1
Fix missing markers on update
Diffstat (limited to 'src/org/traccar/web/server/model/DataServiceImpl.java')
-rw-r--r-- | src/org/traccar/web/server/model/DataServiceImpl.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/web/server/model/DataServiceImpl.java b/src/org/traccar/web/server/model/DataServiceImpl.java index fb8724ae..db10bd5e 100644 --- a/src/org/traccar/web/server/model/DataServiceImpl.java +++ b/src/org/traccar/web/server/model/DataServiceImpl.java @@ -339,9 +339,11 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService if (results.isEmpty()) { entityManager.getTransaction().begin(); try { - device = entityManager.merge(device); + Device tmp_device = entityManager.find(Device.class, device.getId()); + tmp_device.setName(device.getName()); + tmp_device.setUniqueId(device.getUniqueId()); entityManager.getTransaction().commit(); - return device; + return tmp_device; } catch (RuntimeException e) { entityManager.getTransaction().rollback(); throw e; |