NotSerializableException when storing entity with composite id in second level cache with lazy-loading bytecode enhancement

Description

NotSerializableException is thrown when trying persist cacheable entity in second level cache. Bytecode enhancement "lazy loading" is enabled.

The exception is catched but storing in cache is not working.

The reason for serializing key is making copy of key.

Testcase is on GitHub

Exception stack:

Environment

Spring boot, Hibernate, H2 database, EHcache

Activity

Show:
Mateusz Pszczolka
May 17, 2019, 3:48 PM
Edited

You can use org.ehcache.jsr107.Eh107IdentityCopier copier as solution.

Assignee

Unassigned

Reporter

Jiri Hohercak

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure