On 2/20/02 4:00 PM, [EMAIL PROTECTED] wrote:

> Does Castor compare the existing top level objects entire object
> graph with the object passed to the update method and add / remove / update
> objects as appropriate?

Steve, I've been trying to figure this out too.  What I learned is that, if
you have called Database.setAutoStore(true) *before* beginning the
transaction, then the object graph will be traversed.

Mostly.  As far as I can tell (in 0.9.3), if the traversal hits a dependent
object that is *not* timestamped from a prior transaction (and should
therefore be automatically created), the traversal stops.  It does *not*
traverse other objects referenced from the object to be created.

Here's an example. In other words, given the object structure:

   master <--> dependent1 --> leaf1
          <--> dependent2 --> leaf2

Assume that dependent2 was just added to master (and thus has no timestamp),
but all the others are timestamped from a prior transaction and should be
updated.

Now if you call Database.update(master) then Castor will automatically
update dependent1 and leaf1, then mark dependent2 for creation.  But it will
do *nothing* with leaf2, so dependent2 will be stored with a NULL leaf
pointer.  Ouch.

I've confirmed this in Castor 0.9.3 and worked around it.  I haven't had a
chance to try it on 0.9.3.9, where lots of this code has been rewritten,
since (as even casual observers of this list will by now have noted) I'm
busy trying to resolve several other things that broke in 0.9.3.9  :-)

[ See also my next message for another related issue for which I'm seeking a
solution. ]


Good luck,

Todd V. Jonker
Inpath Solutions, LLC
www.inpathsol.com

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to