[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4451) StatefulPersistenceContext.deserialize must re-inject field interceptors after reading the entities from the input stream

strong liu (JIRA) noreply at atlassian.com
Sat Sep 26 14:34:50 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=34053#action_34053 ] 

strong liu commented on HHH-4451:
---------------------------------

https://jira.jboss.org/jira/browse/JBPAPP-2839

> 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