[ 
https://issues.apache.org/jira/browse/MNEMONIC-464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16359115#comment-16359115
 ] 

Wang, Gang commented on MNEMONIC-464:
-------------------------------------

Hi [~Tao Jie] , thank you for bringing this up here. from my understanding, 
you'd like to hold a volatile object b in a durable object a as a field B. and 
propose a DurableReference to survive the reference to b from destroying and 
restoring of the durable object a. if my understanding is correct, looks, Java 
seems not provide the way to hold the reference of an object out of the context 
of runtime. anyone can help if any idea or solution? thanks.

> Support normal java object field in durable type
> ------------------------------------------------
>
>                 Key: MNEMONIC-464
>                 URL: https://issues.apache.org/jira/browse/MNEMONIC-464
>             Project: Mnemonic
>          Issue Type: New Feature
>    Affects Versions: 0.11.0
>            Reporter: Tao Jie
>            Assignee: Tao Jie
>            Priority: Major
>
> Today, we define a durable type(eg: DurableA), we may define a normal object 
> field(B b). When we restore a DurableA object a(eg: we put a into a 
> DurableHashMap and get it from the map later), its reference of b would lost. 
> As discussed with [~qichfan] offline, one solution is that we maintain a 
> Map<B_ID, B> to keep the reference of B and have a B_ID(long type) field in 
> DurableA. Then we can find the object b from restored object A.
> We can do this in the Mnemonic framework, and add a new type (maybe 
> DurableReference?) to support this situation. like:
> {code}
> class DurableA {
>  @DurableGetter
>   public abstract DurableReference<B> getFieldB();
>   @DurableSetter
>   public abstract void setFieldB(DurableReference<B> b, boolean destroy) 
> }
> {code}
> Then we can get object b by
> {code}
> a.getFieldB().get()
> {code}
> Any thought?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to