selective commit

Chris Muller ma.chris.m at gmail.com
Tue Jun 12 15:20:12 UTC 2012


Ah ok.  Yes, there are actually two ways to do it.

1) you can implement #maTransientVariables on any class to declare its
named inst-vars which should be ignored by Magma.  Just answer an
Array of the inst-var names (it can be calculated dynamically).  This
is the easiest solution to cause Magma to ignore particular object
links.

2) Your example was with Array though, which doesn't have named
inst-vars.  For that you would have to use a MaImmutabilityStrategy
which lets you specify objects to be immutable by a condition block.
It can even ignore a reference based on conditions of the *Referencer*
(e.g.,  the referencing object) instead of only the referenced object.
 See MagmaTestCase>>#commitWithImmutabilityStrategy for usage details.

Hope this helps,
  Chris



On Tue, Jun 12, 2012 at 1:25 AM, Milan Mimica <milan.mimica at gmail.com> wrote:
> Suppose my root is anArray. Now I load two elements from that array:
> a := session root at: 1.
> b := session root at: 2.
>
> Then I mutate both of them.
> Now I want to commit changes I made to 'a', but not 'b'.
>
> On 11 June 2012 22:26, Chris Muller <asqueaker at gmail.com> wrote:
>>
>> Hi Milan, I don't understand -- ...you have a (Magma?) database and
>> you want to commit changes to some of the objects in the database but
>> not all of them?  That obviously works so I guess you are asking about
>> something different -- could you please clarify?
>>
>>
>>
>> On Mon, Jun 11, 2012 at 1:42 PM, Milan Mimica <milan.mimica at gmail.com>
>> wrote:
>> > Hi
>> >
>> > Do I understand correctly that Magma doesn't support commit on per
>> > instance
>> > basis? I want to commit only some of the some instances I have loaded
>> > from
>> > database.
>> >
>> >
>> > --
>> > Milan Mimica
>> > http://sparklet.sf.net
>> >
>> > _______________________________________________
>> > Magma mailing list
>> > Magma at lists.squeakfoundation.org
>> > http://lists.squeakfoundation.org/mailman/listinfo/magma
>> >
>
>
>
>
> --
> Milan Mimica
> http://sparklet.sf.net


More information about the Magma mailing list