UCP Oracle Hibernate Pessimistic Locking

45 Views Asked by At

I have a code that is running on Jboss EAP 7.4 and that is using JPA pessimistic locking (select for update wait).

It is working fine with Jboss datasource but when I try to use UCP datasource the locking mechanism is not blocking any more.

Versions:

  • UCP version is 19.3.9.0
  • Java version is 8
  • Hibernate version is 4.2.11 (but same thing with version 5.1.17).

Is there a connection property to setup in UCP to enable the locking mechanism ?


I tried 2 concurrent threads call if a Spring Data JPA repository throught a Spring @Transactional(REQUIRES_NEW) annotation.

Using query.setLockMode(PESSIMISTIC_WRITE);

Expected the second thread to be blocked until the first thread has committed its thransaction.

0

There are 0 best solutions below