aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/at/ac/tuwien
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/ac/tuwien')
-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...
- }
}
}