try the cvs version.  I had same problem and Thomas fixed it a few weeks
ago.  make sure you objects implement TimeStampable for long transaction.
You should be able to do something like this:

c.setValue1("somevalue");
db.begin();
db.update(c);
db.commit();

notice you're modifying c outside to the transaction then just update.

good luck.


-----Original Message-----
From: Julian L�ffelhardt [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 20, 2001 5:52 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] JDO: update() & relations


Hi,
I have the following question:
If I have an object strucutre similar to the following:

A 1--->n B 1---->n C


db.begin();
c.setValue1("somevalue");
db.update(c);
db.commit();

and I want to update object C I getan error like:
error object C contains reference to object B which is not created/loaded in
this transaction

than I try:

db.begin();
c.setValue1("somevalue");
db.update(c);
db.update(b);
db.commit();

I get an error like:
error object B contains reference to object A which is not created/loaded in
this transaction

an do on...

Problem is I#m having a rather comp�lex structure of classes forcing me to
call update on about 12 objects when I want to change a simple value.
Any advice???

P.S: the "autostore" function seems completely broken, whenever I enab�le
autostore Castor starts to blindly create new objects e.g.

A 1--->n B 1---->n C


db.begin();
c.setValue1("somevalue");
db.update(c);
db.commit();

creates "sometimes" a new instance of a and B althought it's already
existing.

Can anybody with the proper insight givr me an advise???

Thanks in advance,

julian L�ffelhardt

-----------------------------------------------------------
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