NPE on flushing when ElementCollection field contains null element

Description

This issue is caused by the performance improvement done on 5.4.4 (and backported on 5.3.11).

the symptom is a NPE when flushing a persisted entity containing a ElementCollection with null as one of the elements in the list.

a test case has been attached

The NPE is also thrown when an automatic flush is triggered (when for example we call getResultList() on a native query).

upgrading to the latest 5.4.6 doesn't fix the issue not downgrading to 5.3.12 but downgrade to 5.4.3 fix the issue...
reverting

Environment

None

Activity

Show:
Yosef Yona
October 3, 2019, 2:21 PM

this is the interesting part of the stacktrace:

 

Caused by: java.lang.NullPointerException
at org.hibernate.type.descriptor.java.AbstractTypeDescriptor.extractHashCode(AbstractTypeDescriptor.java:78)
at org.hibernate.type.AbstractStandardBasicType.getHashCode(AbstractStandardBasicType.java:200)

Yosef Yona
October 3, 2019, 2:23 PM

test case attached

Yaffa Ziv
October 22, 2019, 8:44 AM

+1

Also a blocker for my company upgrading to 5.4.6

Sanne Grinovero
October 24, 2019, 10:30 AM

thanks! The next maintence release will include your fix.

Gail Badner
January 7, 2020, 9:43 PM

Fixed in 5.3 branch.

Fixed

Assignee

Yosef Yona

Reporter

Yosef Yona

Fix versions

Labels

None

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.4.3

Components

Affects versions

Priority

Blocker
Configure