Thomas,
What does your mapping look like? I believe that you have run into the fact
that by default caching is turned on. If you want to insure that each
retrieval involves a trip to the db (which I would think you would if
someone can affect the db outside of your code), then add <cache-type
type="none"/> to the mapping for your class -

HTH -
Margaret

-----Original Message-----
From: Thomas Olausson [mailto:thomas.olausson@;home.se]
Sent: Wednesday, November 13, 2002 2:30 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] what makes JDO think objects are dirty?


Rhett wrote,
> You have to commit after you finish whatever amount of work needs to be
done atomically

It doesn't matter, I still get the old objects.

The server is singlethreaded, has one instance to
castor Database which is opened at startup

this is what basically happens:

I have an Object A which has a vector of B's

1. one request
db.begin();
myOQL =db.getOQLQuery("SELECT ...");
myOQL.bind("123");
objectA= (ObjectA) results.next();
// print out the number of B's, let's say it comes out to 5
// add a new ObjectB to A's vector
// print out the number of B's, comes out to 6
db.commit();

2.
I look at the database rows and the new ObjectB has been inserted

3.
someone manually deletes all the B-rows in the database

4. another request
db.begin();
myOQL =db.getOQLQuery("SELECT ...");
myOQL.bind("123");
objectA= (ObjectA) results.next();
// print out the number of B's, 
// it should be zero, but it's actually 6,
// the last object is cached
// add a new ObjectB to A
// print out the number of B's, should be 1, but comes out to 7
db.commit();

/Thomas

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