From 05d3ba6f48a502ff9f73bd551ad8e95b558d43f3 Mon Sep 17 00:00:00 2001 From: a Date: Sat, 13 Jun 2026 10:12:09 +0100 Subject: [PATCH] Add @Transactional to user write/read service methods (Panache needs ambient tx) --- .../software/proprietary/security/service/UserService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/proprietary/src/main/java/stirling/software/proprietary/security/service/UserService.java b/app/proprietary/src/main/java/stirling/software/proprietary/security/service/UserService.java index 8bfedde7c6..fe14ef9c99 100644 --- a/app/proprietary/src/main/java/stirling/software/proprietary/security/service/UserService.java +++ b/app/proprietary/src/main/java/stirling/software/proprietary/security/service/UserService.java @@ -175,6 +175,7 @@ public class UserService implements UserServiceInterface { return apiKey; } + @Transactional public User addApiKeyToUser(String username) { Optional userOpt = findByUsernameIgnoreCase(username); User user = saveUser(userOpt, generateApiKey()); @@ -225,6 +226,7 @@ public class UserService implements UserServiceInterface { return userRepository.findByApiKey(apiKey).isPresent(); } + @Transactional public Optional getUserByApiKey(String apiKey) { return userRepository.findByApiKey(apiKey); } @@ -392,6 +394,7 @@ public class UserService implements UserServiceInterface { databaseService.exportDatabase(); } + @Transactional public void changePassword(User user, String newPassword) throws SQLException, UnsupportedProviderException { user.setPassword(passwordEncoder.encode(newPassword)); @@ -414,6 +417,7 @@ public class UserService implements UserServiceInterface { databaseService.exportDatabase(); } + @Transactional public void changeUserEnabled(User user, Boolean enbeled) throws SQLException, UnsupportedProviderException { user.setEnabled(enbeled); @@ -479,6 +483,7 @@ public class UserService implements UserServiceInterface { * @throws SQLException If a database error occurs * @throws UnsupportedProviderException If an unsupported provider is specified */ + @Transactional public User saveUserCore(SaveUserRequest request) throws IllegalArgumentException, SQLException, UnsupportedProviderException {