summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/Database.java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/Database.java')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/Database.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/Database.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/Database.java
index 17d7a6c7..204cfcb0 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/Database.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/Database.java
@@ -56,7 +56,14 @@ public class Database {
}
if (!busyConnections.add(con))
throw new RuntimeException("Tried to hand out a busy connection!");
- return con;
+ try {
+ // By convention in our program we don't want auto commit
+ con.setAutoCommit(false);
+ return con;
+ } catch (SQLException e) {
+ con.release();
+ continue;
+ }
}
// No pooled connection
if (busyConnections.size() > 20) {