ClassCastException with second level cache and entityManager.find(clazz, id)

Description

From my post on the dev list:

We just hit the ClassCastException problem with 2nd level cache
reported by other people.

But... we're using 4.3.4.Final so I'm not sure this issue has really
been fixed with 4.3.4.Final.

Typically, we have the following hierarchy:

1 2 3 AbstractUser TechnicalUser (id = 1) AccountManager (id = 2)

entityManager.find(AccountManager.class, 1) returns the TechnicalUser
1 and not null if the 2nd level cache is enabled (and the object is in
the cache).

I'm pretty sure it's not the expected behavior.

Environment

None

Status

Assignee

Brett Meyer

Reporter

Guillaume Smet

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Affects versions

4.3.4

Priority

Major