You need to update() an object before it can be used in a long transaction.
If you don't do it, Castor JDO will treat it as "transparence".
Also, you need implements Timestampable.
Also, I think some of your other problems can be fixed by using the cvs
version.
Thomas
> db.begin();
> MyObject OBJ = (MyObject)db.load(MyObject.class,new Integer(1));
> db.commit();
> db.begin(); <-- Not a Long Transaction, unless you uses update
db.update(OBJ);
> obj.setMyObject(OBJ);
> obj.setName("Object 3");
> db.create(obj);
> db.commit();
-----Original Message-----
>From: Wap Brunei [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, December 06, 2001 5:37 PM
>To: [EMAIL PROTECTED]
>Subject: [castor-dev] Long Transaction Problem
>
>I have a mapping like this
>
> <field name="MyObject" type="jdotest.MyObject">
> <sql name="Object_id"/>
> </field>
>
>
> db.begin();
> MyObject OBJ = (MyObject)db.load(MyObject.class,new Integer(1));
> db.commit();
> db.begin(); <-- Long Transaction Begin
> obj.setMyObject(OBJ);
> obj.setName("Object 3");
> db.create(obj);
> db.commit();
>
> // This will set a NULL value to the the Object_id field
>
>
> db.begin();
> MyObject OBJ = (MyObject)db.load(MyObject.class,new Integer(1));
> obj.setMyObject(OBJ);
> obj.setName("Object 3");
> db.create(obj);
> db.commit();
>
> // This will set the value correctly
>
>Why the value will set to NULL within a Long Transaction. Another know how
>to set the value correctly with a Long Transaction.
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>-----------------------------------------------------------
>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