This one time, at band camp, Guy Di Fulvio said:

GDF>Here something else on the same pattern that does not work. Could anyone
GDF>tell me why?
GDF>
GDF>Load an object Client 2/close the transaction
GDF>Load an object Application 1
GDF>Set application.client = Client 2
GDF>Call application.update
GDF>
GDF>The error is:
GDF>org.exolab.castor.jdo.PersistenceException: Object,
GDF>test.WApplicationJDO@a613f8, links to another object,
GDF>test.WClientJDO@6921fd that is not loaded/updated/created in this
GDF>transaction
GDF>
GDF>See code below:
GDF>_db = getDatabase();
GDF>_db.setAutoStore(false);
GDF>_db.begin();
GDF>WClientJDO client = (WClientJDO)_db.load(WClientJDO.class,new
GDF>BigDecimal(2));
GDF>_db.commit();
GDF>_db.close();
GDF>
GDF>_db = getDatabase();
GDF>_db.setAutoStore(false);
GDF>_db.begin();
GDF>WApplicationJDO application =
GDF>(WApplicationJDO)_db.load(WApplicationJDO.class,new BigDecimal(1));
GDF>application.setJdoClient(client);
GDF>_db.commit();
GDF>_db.close();

OK, here's a bit more detail in this one. 

WClientJDO and WApplicationJDO have a bi-directional relationship
established between them via the mapping descriptor. If you load the
client object as read-only, but then you associate it with the application
object, the client object must change. This is certainly going to be a
problem because Castor cannot modify the client object letting it know
with which application object it is associated.

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

Reply via email to