I have done some further research into this issue and have found the
following :
1) By placing print statements in the Company's addEmployee() method, I have
verified that Castor is really calling addEmployee with employees whose
company attribute does not match the company upon which the method is being
called.  An example is "Adding companyPerson [id=2101, emp.comp.id=1] for
this company [id=6]"

2) Removing the add methods and allowing access to only set methods had
interesting results.  Castor called setEmployees, for example, 3 times for
each company, one time with the correct number "sandwiched" between two
calls with the incorrect counts.



********************************************
Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com

********************************************


-----Original Message-----
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 02, 2002 12:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Date: Fri, 1 Mar 2002 18:54:41 -0600


By the way, I did find one way to force it work correctly:

1) Made all classes non castor cacheable.
2) performed the following code instead of the earlier code:

            Database db = ....;
            OQLQuery oql;
            QueryResults rs;
            Company c = null;
            LookupListItem lli = null;

            db.begin();

            oql = db.getOQLQuery( 
                    "SELECT p FROM com.vignette.it.apps.jdo.CompanyImpl p"
            );
            java.util.ArrayList rslts = new java.util.ArrayList();
            java.util.Vector ids = new java.util.Vector();

            rs = oql.execute();

            while ( rs.hasMore() )
            {
                c = (Company)rs.next();
                ids.add( c.getId() );
            }

            db.rollback();

            db.begin();

            for (java.util.Iterator it=ids.iterator(); it.hasNext(); )
            {
                Integer id = (Integer)it.next();
                c = (Company)db.load( CompanyImpl.class, id );
                System.out.println(
"*************************************************" );
                System.out.println( " Id           : " + c.getId() );
                System.out.println( " Name         : " + c.getName() );
                System.out.println( "  Employees   : " +
c.getEmployees().size() );
                System.out.println( "  Locations   : " +
c.getLocations().size() );
                System.out.println(
"*************************************************" );
            }

            /*  db.commit();  */
            db.rollback();




********************************************
Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com

********************************************


-----Original Message-----
From: Bruce Snyder [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 01, 2002 10:39 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Date: Fri, 1 Mar 2002 18:54:41 -0600


This one time, at band camp, Ebersole, Steven said:

ES>The counts for company id=1 is correct (it really does have 1289
employees
ES>and 0 locations).
ES>The counts for company id=4 are incorrect (it really has 0 employees and
4
ES>locations).
ES>The counts for company id=5 are incorrect (it really has 0 employees and
1
ES>locations).
ES>The counts for company id=6 are incorrect (it really has 1 employees and
7
ES>locations).
ES>
ES>
ES>Does anyone have any idea what could be causing this?  And more
importantly,
ES>how to correct?

Steve,

You stated in your previous message that you're using long transactions,
yet there are no illustration of your use of them. Also, let's see
the mapping descriptor.

Bruce
--

perl -e 'print
unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

----------------------------------------------------------- 
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

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

Reply via email to