diff --git a/lib/taskana-core/src/main/java/pro/taskana/task/internal/TaskQuerySqlProvider.java b/lib/taskana-core/src/main/java/pro/taskana/task/internal/TaskQuerySqlProvider.java
index f282b027ec..3fda287d3a 100644
--- a/lib/taskana-core/src/main/java/pro/taskana/task/internal/TaskQuerySqlProvider.java
+++ b/lib/taskana-core/src/main/java/pro/taskana/task/internal/TaskQuerySqlProvider.java
@@ -70,9 +70,11 @@ public static String queryTaskSummaries() {
+ "ORDER BY ${item}"
+ " "
+ " "
- + "FETCH FIRST ROW ONLY FOR UPDATE"
+ + "FETCH FIRST ROW ONLY FOR UPDATE "
+ ""
- + "WITH RS USE AND KEEP UPDATE LOCKS "
+ + "WITH RS USE "
+ + "AND KEEP UPDATE LOCKS "
+ + "WITH UR "
+ CLOSING_SCRIPT_TAG;
}
@@ -429,9 +431,7 @@ private static String groupBySorIfActive() {
}
private static String openOuterClauseForGroupByPorOrSor() {
- return " "
- + "SELECT * FROM ("
- + " ";
+ return " " + "SELECT * FROM (" + " ";
}
private static String closeOuterClauseForGroupByPor() {