diff options
-rw-r--r-- | .settings/org.eclipse.jdt.core.prefs | 10 | ||||
-rw-r--r-- | .settings/org.eclipse.wst.common.project.facet.core.xml | 2 | ||||
-rw-r--r-- | src/org/traccar/web/server/model/DataServiceImpl.java | 10 |
3 files changed, 13 insertions, 9 deletions
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index f42de363..8000cd6c 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,11 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index bc0009a4..bcfc3250 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <faceted-project> - <installed facet="java" version="1.7"/> + <installed facet="java" version="1.6"/> </faceted-project> 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; } |