Skip to content

updating spring boot to 3.4 changes behaviour of findById in CrudRepository #46318

@jonathanSimonney

Description

@jonathanSimonney

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fixfor: stackoverflowA question that's better suited to stackoverflow.comstatus: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions