[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4451) StatefulPersistenceContext.deserialize must re-inject field interceptors after reading the entities from the input stream
Hardy Ferentschik (JIRA)
noreply at atlassian.com
Mon Sep 21 13:28:50 EDT 2009
StatefulPersistenceContext.deserialize must re-inject field interceptors after reading the entities from the input stream
-------------------------------------------------------------------------------------------------------------------------
Key: HHH-4451
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4451
Project: Hibernate Core
Issue Type: Bug
Components: core
Reporter: Hardy Ferentschik
Assignee: Steve Ebersole
Not re-injecting the interceptors for instrumented entities will cause NullPointerExceptions when entities get retrieved from a deserialized PersistenceContext. This manifests itself for example in the unit test EntityManagerSerializationTest in the entity manager module (when run instrumented of course).
Currently the problem occurs in line 1406 of StatefulPersistenceContext: rtn.entitiesByKey.put( EntityKey.deserialize( ois, session ), ois.readObject() )
I think FieldInterceptionHelper.injectFieldInterceptor should be called here. Something along these lines:
Object key = EntityKey.deserialize( ois, session );
Object value = ois.readObject();
FieldInterceptionHelper.injectFieldInterceptor( value, value.getClass().getName(), null, session );
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list