Advertisement
Guest User

Untitled

a guest
Sep 8th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. spring.datasource.url=jdbc:mysql://foo.bar.com:12345
  2. spring.datasource.username=user
  3. spring.datasource.password=password
  4. spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  5.  
  6. @Service
  7. public class ProjectServiceImpl implements ProjectService {
  8.  
  9. @Autowired
  10. ProjectRepository projectRepository;
  11.  
  12. @Override
  13. @Transactional(isolation = Isolation.SERIALIZABLE)
  14. public Project save(Project project) {
  15. // there might be some additional logic here, besides the action on repository
  16. return projectRepository.save(project);
  17. }
  18.  
  19. }
  20.  
  21. @Repository
  22. public interface ProjectRepository extends CrudRepository<Project, Long> {}
  23.  
  24. "exception": "org.springframework.transaction.InvalidIsolationLevelException",
  25. "message": "JtaTransactionManager does not support custom isolation levels by default - switch 'allowCustomIsolationLevels' to 'true'",
  26.  
  27. transactionManager.setAllowCustomIsolationLevels(true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement