Here something else on the same pattern that does not work. Could anyone tell me why?
Load an object Client 2/close the transaction Load an object Application 1 Set application.client = Client 2 Call application.update The error is: org.exolab.castor.jdo.PersistenceException: Object, test.WApplicationJDO@a613f8, links to another object, test.WClientJDO@6921fd that is not loaded/updated/created in this transaction See code below: _db = getDatabase(); _db.setAutoStore(false); _db.begin(); WClientJDO client = (WClientJDO)_db.load(WClientJDO.class,new BigDecimal(2)); _db.commit(); _db.close(); _db = getDatabase(); _db.setAutoStore(false); _db.begin(); WApplicationJDO application = (WApplicationJDO)_db.load(WApplicationJDO.class,new BigDecimal(1)); application.setJdoClient(client); _db.commit(); _db.close(); -----Message d'origine----- De�: Bruce Snyder [mailto:ferret@;frii.com] Envoy�: mercredi 6 novembre 2002 23:45 ��: [EMAIL PROTECTED] Objet�: Re: [castor-dev] Problem in inserting table with foreign key This one time, at band camp, Guy Di Fulvio said: GDF>Here is a test project (Run ApplicationJDOTest file using JUnit). GDF> GDF>Notes: GDF>- testMapping and testDatabase files are in the "properties" directory. GDF>- Before running please check the path for the testMapping file in GDF>testDatabase.xml. Check also the testMapping and the testDatabase file GDF>path in OpenCSTestCase.java. GDF> GDF>If you run the test program you will get an error: Cannot affect null GDF>value to not null column. GDF> GDF>If you remove in the ddl file the "not null" beside CLI_ID the test will GDF>work but in the database the CLI_ID for "Test Application 1" will be GDF>null. GDF> GDF>"Test Application 2" works because it is in the same transaction (not GDF>using the long transaction). My apologies for the delay in my response. I've taken a look at the test you sent me and I don't see a long transaction anywhere. A Castor long transaction makes use of db.update() to bring the changed object into the context of the second short transaction (http://www.castor.org/long-transact.html). What I can tell you is that there is a test in src/test/jdo/DependentOrder.java that is similar to what you're trying to accomplish (a dependent object using the MAX key generator). Take a look at this and see if it helps at all. 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
