From de9487c9c3e1b088bb2774751f8b0d0e3a5c7fce Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 12 Jan 2013 16:56:42 +1300 Subject: Change Java version to 1.6 --- src/org/traccar/web/server/model/DataServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/org/traccar/web/server') diff --git a/src/org/traccar/web/server/model/DataServiceImpl.java b/src/org/traccar/web/server/model/DataServiceImpl.java index a1ea80be..57357aa8 100644 --- a/src/org/traccar/web/server/model/DataServiceImpl.java +++ b/src/org/traccar/web/server/model/DataServiceImpl.java @@ -116,7 +116,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService try { entityManager.persist(user); entityManager.getTransaction().commit(); - } catch (Exception e) { + } catch (RuntimeException e) { entityManager.getTransaction().rollback(); throw e; } @@ -140,7 +140,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService entityManager.persist(device); user.getDevices().add(device); entityManager.getTransaction().commit(); - } catch (Exception e) { + } catch (RuntimeException e) { entityManager.getTransaction().rollback(); throw e; } @@ -153,7 +153,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService try { device = entityManager.merge(device); entityManager.getTransaction().commit(); - } catch (Exception e) { + } catch (RuntimeException e) { entityManager.getTransaction().rollback(); throw e; } @@ -170,9 +170,9 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService // If you want to remove device you need to remove all linked positions //entityManager.remove(device); entityManager.getTransaction().commit(); - } catch (Exception e) { + } catch (RuntimeException e) { entityManager.getTransaction().rollback(); - throw e; + } return device; } -- cgit v1.2.3