Skip to content

Commit

Permalink
Fix postgres LOB auto commit not allowed
Browse files Browse the repository at this point in the history
This is a workaround as found here: vaadin/starters#94
See also: vaadin/starters#85

To run the docker compose, you must also set the vaadin app to
production mode and build the java project, then build the docker
container before running docker compose (you can also just run `docker
compose up --build`)
  • Loading branch information
tikelespike committed Feb 13, 2023
1 parent c25e232 commit e319c91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public AuthenticatedUser(AuthenticationContext authenticationContext, UserReposi
this.authenticationContext = authenticationContext;
}

@Transactional
public Optional<User> get() {
return authenticationContext.getAuthenticatedUser(UserDetails.class)
.map(userDetails -> userRepository.findByUsername(userDetails.getUsername()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public UserDetailsServiceImpl(UserRepository userRepository) {
this.userRepository = userRepository;
}

@Transactional
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
User user = userRepository.findByUsername(username);
Expand Down

0 comments on commit e319c91

Please sign in to comment.