| I stumbled over this issue because I am struggling with the same issue. I created a runnable test using the provided template. As a short explanation: In total there are 3 testcases implemented in PessimisticWriteLockBaseTest. The first test asserts that the correct exception class (javax.persistence.LockTimeoutException) is thrown. The second test asserts that a LockTimeoutException is thrown immediately if the property "javax.persistence.lock.timeout" is set to 0. The third test asserts that a LockTimeoutException is thrown after the specified timeout if the property "javax.persistence.lock.timeout" is set to a non zero value. While testing I observed a different behavior between a h2 and mysql. Therefore I created two persistence units and two test classes simply extending the PessimisticWriteLockBaseTest. The mysql test cases requires a running mysql database. I added a mysql.yml file to simply start a mysql docker from IntelliJ. |