Skip to content

NullPointerException during JPA deleteAll with lazy collections #35617

@pwandl

Description

@pwandl

Since upgrading to Spring Boot 3.1.0 from 3.0.6 we are experiencing NPEs when calling .deleteAll() on Spring Data JPA repositories, but not for each entity. I suspect it is related to entities which contain lazy collections, but could not narrow it down further yet.

I have extracted a minimal sample application which shows the issue: https://github.com/pwandl/spring-hibernate-bug-demo

It seems to only occur if the transaction calling .deleteAll has not previously modified the to-be-deleted entities. I was not yet able to reproduce the issue using hibernate directly without any spring components, so I suspect that it might be related to some spring component, even though the issue does not occur when downgrading hibernate to 6.1.7

Metadata

Metadata

Assignees

Labels

for: external-projectFor an external project and not something we can fixstatus: 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