summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2022-11-07 11:54:57 +0100
committerSimon Rettberg2022-11-07 11:54:57 +0100
commitbaf25286040f6c5dcdb69f2e882913a6fc998a97 (patch)
tree807ad791d8aa2c02fd349ccf617a4449feaf9a9e
parent[server] Remove apache commons dependencies (diff)
downloadtutor-module-baf25286040f6c5dcdb69f2e882913a6fc998a97.tar.gz
tutor-module-baf25286040f6c5dcdb69f2e882913a6fc998a97.tar.xz
tutor-module-baf25286040f6c5dcdb69f2e882913a6fc998a97.zip
[server] Try to catch weird bug when deleting old images
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/MysqlConnection.java2
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbImage.java2
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/maintenance/DeleteOldImages.java2
3 files changed, 3 insertions, 3 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/MysqlConnection.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/MysqlConnection.java
index 71b6e603..f1e5e075 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/MysqlConnection.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/MysqlConnection.java
@@ -52,7 +52,7 @@ public class MysqlConnection implements AutoCloseable {
@Override
public void close() {
if (hasPendingQueries) {
- LOGGER.warn("Mysql connection had uncommited queries on .close()", new RuntimeException());
+ LOGGER.warn("Mysql connection had uncommited queries on .close()", new RuntimeException("Stack trace"));
hasPendingQueries = false;
}
try {
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbImage.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbImage.java
index 6064e800..49dfaa9f 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbImage.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbImage.java
@@ -707,7 +707,7 @@ public class DbImage {
stmt.setString("imageversionid", image.imageVersionId);
stmt.executeUpdate();
connection.commit();
- } catch (SQLException e) {
+ } catch (Exception e) {
LOGGER.error("Query failed in DbImage.deleteVersionPermanently(2)", e);
throw e;
}
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/maintenance/DeleteOldImages.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/maintenance/DeleteOldImages.java
index bd46b7f3..c99133aa 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/maintenance/DeleteOldImages.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/maintenance/DeleteOldImages.java
@@ -140,7 +140,7 @@ public class DeleteOldImages implements Runnable {
FileSystem.deleteImageRelatedFiles(version);
try {
DbImage.deleteVersionPermanently(version);
- } catch (SQLException e) {
+ } catch (Exception e) {
writeln(sb, version.imageVersionId, ": Cannot delete image: ", e.getMessage());
}
writeln(sb, version.imageVersionId, ": OK");