This one time, at band camp, Techeira, Vincent X -ND said:

Vincent, 

Please see my comments inline. 

TVXN>If you call expireCache on an object that's already loaded, exactly what happens. 
 Does Castor invalidate the object reference or does it invalidate the cache entry?  

Only the cache entry is invalidated. The next time this object is loaded
it will be done from the database.

TVXN>Is this affected by access mechanism ("read-only", "shared", etc) that the object 
was loaded under?

The access level of the object has no bearing on the expireCache
functionality.

TVXN>Consider the case where an object is loaded is shared access mode, if the cache 
is expired and then an update is called on the expired object what happens?  Is an 
ObjectModifiedException thrown, or is the cached version overwritten?

Good question. We'll need to write some tests for this (CTF-JDO) to
find out.

TVXN>Can you expire the cache entry for an object that is loaded for exclusive access 
(e.g. an object that's about to be persisted)?
TVXN>
TVXN>Can you expire the cache of an object that's involved in a transaction?  If so 
how is this handled?

Again, let's write some tests and find out. 

TVXN>The javadocs of expireCache suggest that the cache of dependent objects are 
automatically expired if their parent object is expired; but only if the parent object 
was expired explicitly (i.e. class type and object id specified).  If the parent 
object was expired implicitly, (i.e. the parent object is of type A, and the cache of 
all type A objects was expired), the dependent objects will need to have their caches 
expired separately.  Is this understanding correct?

Yes, this is exactly how expiration by type  works. 

TVXN>I expect to be able to answer some of these questions myself by review the code 
implementation and through experimentation; however this can costly timewise.  If 
anyone has this knowledge readily available (Vincent, Bruce, et al) it would be 
greatly  appreciated.  Rest assured, that all I learn will be shared as well.

There are two tests for the expireCache API at this
time. They are src/tests/jdo/expireLazyEmployee.java and and
src/tests/jdo/expireManyToMany.java. We obviously need more tests surround
this API. If you're willing to help out and learn a bit, please see the
doc on the CTF-JDO:

    http://www.castor.org/test-framework.html

Bruce
-- 
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&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

Reply via email to