Hi! Recently, I was asked how to manage transactions against databases in this multithread world.
So, I have spent my time in the last week studying some solutions. I start, understanding about Optimistic Locking and Pessimistic Locking. Here is a great article to do that: https://www.baeldung.com/jpa-pessimistic-locking
I used a number of open source projects to work properly:
- [SpringBoot]
- [JUnit]
- [H2]
- [Hibernate]
Run the IntegrationTest! Run the IntegrationEtagsTest!
Enjoy it!