Clustered L2 cache does not support class definition updates

Description

Hibernate caches raw arrays of field values in L2 cache. If that cache is clustered, and you want to update nodes one by one, you can get into a lot of trouble. Session may fetch a cache entry with old schema and blindly try and copy it to an entity. Sometimes it leads to ClassCastException. It also may lead to data corruption (disassembling a field as null and then saving that to database).

There does not seem to be a way to work this around. serialVersionUID is unsupported and I don't see a way to mark entity definition version anywhere in the mapping.

I'm experiencing this in 3.3.1, but from a brief source code inspection it seems to still be an issue in 4.

Environment

None

Activity

Show:
Konrad Garus
September 3, 2011, 7:04 AM

I sparked some discussion on my blog (with ideas for fixes): http://squirrel.pl/blog/2011/08/24/hibernate-cache-is-fundametanlly-broken

And on Reddit: http://www.reddit.com/r/java/comments/jtbsy/hibernate_cache_is_fundamentally_broken/

(Just to avoid reiterating the same arguments)

Brett Meyer
April 8, 2014, 3:42 AM

In an effort to clean up, in bulk, tickets that are most likely out of date, we're transitioning all ORM 3 tickets to an "Awaiting Test Case" state. Please see http://in.relation.to/Bloggers/HibernateORMJIRAPoliciesAndCleanUpTactics for more information.

If this is still a legitimate bug in ORM 4, please provide either a test case that reproduces it or enough detail (entities, mappings, snippets, etc.) to show that it still fails on 4. If nothing is received within 3 months or so, we'll be automatically closing them.

Thank you!

Brett Meyer
July 9, 2014, 1:10 AM

Bulk rejecting stale issues. If this is still a legitimate issue on ORM 4, feel free to comment and attach a test case. I'll address responses case-by-case. Thanks!

Rejected

Assignee

Unassigned

Reporter

Konrad Garus

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