newbie questions

Chris Muller chris at funkyobjects.org
Thu Oct 12 02:22:39 UTC 2006


If the Diner is referenced by the persistent graph and you have not set
refreshPersistentObjectsEvenWhenChangedOnlyByMe: to true (i.e., leave
that false, always), then lazy-initializing the Diner should be fine
and it should get persisted; upon your next mySession begin; commit,
even if the reference to the Diner made outside the transaction AND
another session did not change that object that now references the
Diner.

Did you find otherwise?  If you post your example maybe it will reveal
why..


--- Hilaire Fernandes <hilaire2006 at laposte.net> wrote:

> Hilaire Fernandes a �crit :
> > Chris Muller a �crit :
> > 
> >>> Is commit: only to be used when you want to persist an object?
> >>
> >>
> >>
> >> To persist an object, you must use commit.
> > 
> > 
> > 
> > Ok, related to this question, here is a situation we are use to:
> lazy 
> > initialization.
> > 
> > Now here is the following situation:
> > 
> > Let's MyClass with an attribute diner which is lazilly initialized
> > 
> > MyClass>>diner
> >   diner ifNil:
> >     [diner := Diner with: self friends].
> >   ^ diner
> > 
> > An intsance of this class is persisted, next outisde of a
> transaction, I 
> >  am accessing the diner attribute, thus a Diner instance is
> created.
> > If I understand correctly this instance will not be persisted.
> > Is it the case?
> 
> I can reply myself after a short experimenation, yes it is the case.
> The 
>   Diner instance will not be persisted.
> 
> Hilaire
> 
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
> 
> 





More information about the Magma mailing list