So let's forget about the long transaction. But could you explain me why
the following code (part of the test I sent) is not working? 

_db = getDatabase();
_db.setAutoStore(false);
_db.begin();

WClientJDO client = 
(WClientJDO)_db.load(WClientJDO.class,new
BigDecimal(1),Database.ReadOnly);
client.setName("Test Client 2");

_db.commit();
_db.close();

WApplicationJDO application = new WApplicationJDO();
application.setName("Test Application 1");
application.setEmail("[EMAIL PROTECTED] 1");
application.setMailServer("server.bbb.net 1");
application.setWeb("localhost:8080 1");
application.setJdoClient(client);

_db = getDatabase();
_db.setAutoStore(false);
_db.begin();

_db.create(application);
_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

Reply via email to