[jboss-jira] [JBoss JIRA] Commented: (JBCACHE-830) Incorrect serialization of Collection and Map proxies

Brian Stansberry (JIRA) jira-events at jboss.com
Thu Nov 2 16:03:41 EST 2006


    [ http://jira.jboss.com/jira/browse/JBCACHE-830?page=comments#action_12346181 ] 
            
Brian Stansberry commented on JBCACHE-830:
------------------------------------------

In previous comment about not being sure about solution, I was thinking in terms of a non-PojoCacheable but serializable object that has a ref to a Collection/Map proxy.  If you place that in the cache, how do you ensure that on the recipient node, the object relationship to the cached Colleciton/Map is maintained?  But actually I don't think that's a requirement at all -- once you place a non-PojoCacheable object in the cache, any expectation of  maintaining object relationships on other nodes is gone.

So, I think the correct solution is to use writeReplace().

> Incorrect serialization of Collection and Map proxies
> -----------------------------------------------------
>
>                 Key: JBCACHE-830
>                 URL: http://jira.jboss.com/jira/browse/JBCACHE-830
>             Project: JBoss Cache
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: PojoCache
>    Affects Versions: 1.3.0.GA, 1.4.0.GA, 1.2.4SP2, 1.3.0.SP1, 1.3.0.SP2, 1.3.0.SP3, 1.4.0.SP1
>            Reporter: Brian Stansberry
>         Assigned To: Ben Wang
>
> The PojoCache Collection and Map proxies implement Serializable but don't do anything to override default serialization.  They have non-transient fields with refs to things like the cache itself, so serializing one of these is a big problem -- you serialize the whole cache.
> Not sure what the best solution to this is. Perhaps use writeReplace()?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list