This is a working example for Oracle database accompanying the blog post "Testing Pessimistic Locking Handling with Spring Boot and JPA"
More examples here:
This SpringBoot maven project is part of my blog post where you could find not only explanation for it, but also theoretical background for:
- What does pessimistic locking handling mean
- How you could implement it within a Spring Boot Application and JPA on the Oralce, MySQL and PostgreSQL databases
- How you could write integration tests for handling pessimistic locking.
- Docker
- JDK8+.
- Start Oracle database container from docker/db-up.sh
- Check with "docker ps" if the container is up&running.
🔔 Ideal for your DevOps pipeline
- Switch profile in InventoryServicePessimisticLockingTest.java to "test" (the default one)
- Run "./mvnw clean verify".
🔔 Ideal for quick local test to try the real database when changing the pessimistic locking handling code
- Switch profile in InventoryServicePessimisticLockingTest.java to "test-oracle"
- Run "./mvnw clean verify".
Have fun and do not hesitate to contact me if you have any questions or suggestions!
My name is Andrey Zahariev Stoev. I am working as Senior Software Architect in Switzerland. I love software craftsmanship and systems thinking. I am passionate about travel, languages and cultural diversity exploration.