aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhurshid Fayzullaev <khurshidfayzullaev@yahoo.com>2014-04-10 16:01:44 -0400
committerKhurshid Fayzullaev <khurshidfayzullaev@yahoo.com>2014-04-10 16:01:44 -0400
commit99a02b06a63a3c48999575a1db2a6dc093812ee2 (patch)
tree2d5ddf89cd711b16c9eacb07aad6b25bfcba9aa2
parent4f0750af0eabce7b6689847d070a0237b1130955 (diff)
downloadetbsa-traccar-web-99a02b06a63a3c48999575a1db2a6dc093812ee2.tar.gz
etbsa-traccar-web-99a02b06a63a3c48999575a1db2a6dc093812ee2.tar.bz2
etbsa-traccar-web-99a02b06a63a3c48999575a1db2a6dc093812ee2.zip
Update DataServiceImpl.java
-rw-r--r--src/org/traccar/web/server/model/DataServiceImpl.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/org/traccar/web/server/model/DataServiceImpl.java b/src/org/traccar/web/server/model/DataServiceImpl.java
index 3164b10..7f4172e 100644
--- a/src/org/traccar/web/server/model/DataServiceImpl.java
+++ b/src/org/traccar/web/server/model/DataServiceImpl.java
@@ -303,12 +303,11 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService
public Device addDevice(Device device) {
EntityManager entityManager = getSessionEntityManager();
synchronized (entityManager) {
- User user = getSessionUser();
-
TypedQuery<Device> query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class);
query.setParameter("id", device.getUniqueId());
List<Device> results = query.getResultList();
+ ser user = getSessionUser();
entityManager.getTransaction().begin();
try {
if (results.isEmpty()) {