On Sun, 01 Aug 2004 01:39:37 +0800, "Yar Hwee Boon"
<
[hidden email]> wrote:
Hi,
> What if I have more than 1 reference to the same
>object (ie. x and y), such that I can only do something like "x
>markDirty"? Thanks.
>............
>x add: 'yyy'.
>["x markDirty." "what should I do here to commit the changes made to x?"]
>evaluateAndCommitIn: db newTransaction.
>db close
I gave my understanding, which may be not totally correct ( it should
leave to the OmniBase for final judge)
According to your code,
........
x add: 'yyy'
.........
[ x markDirty ] evaluateAndCommitIn: db newTransaction.
I think It won't work, because x is not a "persistent object" ( i.e.
not inside a transaction).
After transaction, x and all the objects referenced to "x" were all
changed to a persisent object, serialized and clustered together with
a unique OID in the database.
x was no more a persistent obejct outside a transaction, so, cann't
be markDirty or committed again.
So, if you want to do something to the persistent "x", you should
get it from the database inside a new transaction again.
i.e.
[ x := OmniBase root at: 'test'.
x add: 'yyy'
x markDirty ] evaluateAndCommitIn: db newTransaction.