I am trying to figure it out how to configure a method not to run within a transaction using Spring. I have read that the Spring Data repositories by default activate the transactional behaviour in its methods. I dont want this transaction because I have many "save" calls to a repository and each of them is independent from the other. I think creating a transaction for each call to a repository method can slow down the code and the performance of the app. So :
- Is this possible or every service or dao method has to run within a transaction?
- If it has, why?
- If this is possible, how to configure a method not to run within a transaction? Just removing the Spring transactional annotation?
Thanks