Commit 4abe2e3dd2d2cb6f2558c912124098c0b6346414
Committed by
jcartign
1 parent
ed4910db
Add @Transactionnal to UserService methods
Showing
2 changed files
with
3 additions
and
1 deletions
Show diff stats
src/main/java/fr/plil/sio/web/mvc/NewUserController.java
@@ -44,4 +44,4 @@ public class NewUserController { | @@ -44,4 +44,4 @@ public class NewUserController { | ||
44 | public void setUserService(UserService userService) { | 44 | public void setUserService(UserService userService) { |
45 | this.userService = userService; | 45 | this.userService = userService; |
46 | } | 46 | } |
47 | -} | 47 | -} |
48 | +} | ||
48 | \ No newline at end of file | 49 | \ No newline at end of file |
src/main/java/fr/plil/sio/web/mvc/UserServiceImpl.java
@@ -35,11 +35,13 @@ public class UserServiceImpl implements UserService { | @@ -35,11 +35,13 @@ public class UserServiceImpl implements UserService { | ||
35 | } | 35 | } |
36 | 36 | ||
37 | @Override | 37 | @Override |
38 | + @Transactional(readOnly = true) | ||
38 | public User findByUsername(String username) { | 39 | public User findByUsername(String username) { |
39 | return userRepository.findByUsername(username); | 40 | return userRepository.findByUsername(username); |
40 | } | 41 | } |
41 | 42 | ||
42 | @Override | 43 | @Override |
44 | + @Transactional(readOnly = true) | ||
43 | public List<User> findAll() { | 45 | public List<User> findAll() { |
44 | return userRepository.findAll(); | 46 | return userRepository.findAll(); |
45 | } | 47 | } |