I'm not sure if this is a question or a bug, so to be extra cautious, I decided to also open an issue. Sorry if this wasn't the proper course of action.
After upgrading spring boot to 3.4, the following method :
@Override
@Lock(LockModeType.PESSIMISTIC_WRITE)
@Nonnull
Optional<DossierDb> findById(@Nonnull UUID id);
in a CrudRepository (defined by
@Repository
public interface DossierDbRepository
extends CrudRepository<DossierDb, UUID>
has stopped throwing PessimisticLockingFailureException (in a test method using retryable).
I still see the log
ERROR: current transaction is aborted, commands ignored until end of transaction block
, but I now get an optional empty when in spring boot 3.3 I got the log AND the error.
I looked in spring data jpa, spring boot release and hibernate 6.5 and 6.6 migration guide but didn't see anything mentioning clearly this change of behaviour.
I also posted a SO question, but in the case it is a true bug, an issue could be warranted.
The expected behavior would be that spring boot 3.4 still throws the PessimisticLockingFailureException rather than "gobbling it up"
Comment From: wilkinsona
Spring Boot isn't really involved at this level. This will either be due to a change in Spring Data JPA or Hibernate. To avoid duplication of effort, I'm going to close this one in favor of your question on Stack Overflow where people are already trying to help you.
/cc @mp911de from the Spring Data team who may have some time to point you in the right direction.