First of all thank you to all of those who have donated time, money and
effort into Castor. Its an amazing framework!

For an example of the code mapping files etc. look at any of  the
ManyToMany examples that come with Castor with one small change, close the
database and open a new database before executing the update (as would
happen in a Web App).  The update on the relationship(collection)  does not
happened in this case.
So in short the problem sequence:

db = jdo.getDatabase();
db.begin()
db.create(object1);
db.commit();
db.close();
// lots of code and time....
// http request response sequence for selection of the contents of the
relationship (collectionOfObject2)
// lots of code and time....
object1.setObject2Collection(collectionOfObject2);

db = jdo.getDatabase();
db.begin();
db.update(object1);
db.commit();
// fails to update the collection without an error being thrown.

 I debugged down to
ClassMolder.update(TransactionContext,OID,DepositBox,Object,AccessMode).
Its is checking for AutoStore being set to true. If AutoStore is false, no
update of the relationship (either in cache or in the database table)
happens. If it is set to true of course everything works as expected.

I find this behavior confusing. Why does AutoStore have an effect on
whether or not the relationship is updated?
If someone could clarify this for me it would be greatly appreciated.

< partial code snippet from ClassMolder />

case FieldMolder.MANY_TO_MANY:
                        fieldClassMolder = _fhs[i].getFieldClassMolder();
                        fieldEngine = _fhs[i].getFieldLockEngine();
                        if ( tx.isAutoStore() ) {
                            Iterator itor = getIterator( _fhs[i].getValue(
object, tx.getClassLoader() ) );
                            ArrayList v = (ArrayList)fields[i];

< end-of-code-snippet />


Terry O'Connor
Sandbox Systems
www.sandboxsystems.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