Bruce,
    Thanx for the test harness. I will try and see if I can reproduce the
problem. I got it to work by creating the child objects outside of the
jdoStore callback method.

      db.create(a);
      a.createChildren(db);

   I did try and see where the problem was but it was so hard to track down.
It was very intermittent and only showed up for objects with lots of
children.

Steve


----- Original Message ----- 
From: "Bruce Snyder" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 15, 2003 8:08 PM
Subject: Re: [castor-dev] problem creating children in jdoStore call back
method


> This one time, at band camp, Stephen Ince said:
>
> SI>I am using a jdoStore callback method to create the child objects
(Class B)  but it doesn't alway create it's children. It is very
intermittent. I  was wondering if I had cache issue. I tried using the
jdoAfterCreate method but that never worked. That generate create errors.I
am doing the following:
> SI>
> SI>Class A  1:n Class B
> SI>
> SI>Class A {
> SI>    jdoStore() {
> SI>        // create B's
> SI>        _db.create(b);
> SI>    }
> SI>}
> SI>
> SI>              db.begin();
> SI>              :
> SI>               while ( iter.hasNext() ) {
> SI>                  a = (ClassA)iter.next();
> SI>                   db.create(a);
> SI>               }
> SI>               db.commit();
> SI>
> SI>I am seeing the top level A object get created but I don't always get
it's children created.  It looks the A's jdoStore method is not always'
being invoked.
>
> Stephen,
>
> There are tests for the callback functionality available in
> src/tests/jdo/Persistent. This is available in either the source downloads
> or CVS. I just ran these tests against MySQL, Oracle and PostgreSQL and
> they all run flawlessly. I suggest comparing your code to the tests.
>
> Bruce
> -- 
> perl -e 'print
unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
>
> The Castor Project
> http://www.castor.org/
>
> Apache Geronimo
> http://incubator.apache.org/projects/geronimo.html
>
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev
>
>

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

Reply via email to