aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/at/ac/tuwien/sepm
diff options
context:
space:
mode:
authorDominic Rogetzer <e1627756@student.tuwien.ac.at>2018-06-16 14:49:30 +0200
committerTharre <tharre3@gmail.com>2018-06-16 15:52:37 +0200
commitd5e8f8559f59a43b6d5907ee2143713d37ae68b4 (patch)
tree4d1bb88aab3c02ab5eebb5e0d9ca8eefc3d4b8af /src/main/java/at/ac/tuwien/sepm
parent6aa57486a2e34f76e88d403fe8363c6f45b68130 (diff)
downloadsepm-groupproject-d5e8f8559f59a43b6d5907ee2143713d37ae68b4.tar.gz
sepm-groupproject-d5e8f8559f59a43b6d5907ee2143713d37ae68b4.tar.xz
sepm-groupproject-d5e8f8559f59a43b6d5907ee2143713d37ae68b4.zip
Remove finally block, reset autocommit in RegistrationDB-DAO [#27305]
Diffstat (limited to 'src/main/java/at/ac/tuwien/sepm')
-rw-r--r--src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDatabaseDAO.java11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDatabaseDAO.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDatabaseDAO.java
index 59f8e52..c3b1227 100644
--- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDatabaseDAO.java
+++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dao/RegistrationDatabaseDAO.java
@@ -83,23 +83,16 @@ public class RegistrationDatabaseDAO implements RegistrationDAO {
updateVehicle.executeUpdate();
connection.commit();
+ connection.setAutoCommit(true);
return returnValues;
} catch (SQLException e) {
try {
connection.rollback();
+ connection.setAutoCommit(true);
} catch (SQLException e1) {
LOG.error("Rollback failed! Error message: {}", e.getMessage());
}
throw new PersistenceException(e);
- } finally {
- try {
- connection.setAutoCommit(true);
- } catch (SQLException e) {
- LOG.error(
- "Setting back AutoCommit to false failed! Error message: {}",
- e.getMessage());
- // SonarLint insists on me not throwing anything here...
- }
}
}