[hibernate-dev] HHH-9701 - Develop "immutable EntityEntry" impl
John O'Hara
johara at redhat.com
Thu Apr 2 05:45:02 EDT 2015
Steve,
I have pushed a proposal for HHH-9701 to:
https://github.com/johnaoahra80/hibernate-orm/tree/HHH-9701
There are a couple of areas that I would appreciate feedback;
1) Serialization/Deserialization - EntityEntries implementations can be
serialized and each implementation provide their own serialization
method. I have modified the serialization of EntityEntry in
EntityEntryContext to write the Implementation class to the OutputStream
so the correct class can be used to deserialize the object stream. Is
the exception handling sufficient here, or do we need more robust
handling of deserialization exceptions? : see
https://github.com/johnaoahra80/hibernate-orm/commit/ec9b1fa3b97131ff1e65a1cc30ff6e4f2d2c8a28#diff-b55e1e51b30abe8d3c280bb22aeb6a44R380
2) In our (perf team) use case, we want to be able to share the
ImmutableEntityEntry between sessions when they are referenced cached in
the 2lc. I have modified EntityEntryContext to not null
managedEntity.$$_hibernate_setEntityEntry if the EntityEntry is an
instance of ImmutableEntityEntry. Do we need to add an extra checks
here, to ensure that the entity is Reference Cached? I am not sure how
we would test that case? : see
https://github.com/johnaoahra80/hibernate-orm/commit/ec9b1fa3b97131ff1e65a1cc30ff6e4f2d2c8a28#diff-b55e1e51b30abe8d3c280bb22aeb6a44L281
3) Lock Mode: Steve you mentioned about not doing locking for Immutable
entities. Where is the locking implemented? Would it be sufficient to
simply set the LockMode on the ImmutableEntityEntry to NONE/READ_ONLY
when setLockMode is called?
Thanks
John
--
John O'Hara
johara at redhat.com
JBoss, by Red Hat
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom.
Registered in UK and Wales under Company Registration No. 3798903 Directors: Michael Cunningham (USA), Charlie Peters (USA), Matt Parsons (USA) and Michael O'Neill (Ireland).
More information about the hibernate-dev
mailing list