Hi Eric,

to use long transactions with castor there are 2 conditions to take care of:

1. the object that you want to take part in long transactions need to implement TimeStampable interface and remember the timestamp set by jdoSetTimeStamp() during the whole long transaction until it is requested with jdoGetTimeStamp() by castor.

2. you need to take care that the object is not thrown out of cache as this would change the timestamp mentioned above. with cache-type="unlimited" you will be on the save side with your cache settings but timelimited and countlimited also work.

Regards
Ralf


Eric Anderson schrieb:
This is what I get when I try to retrive the objects timestamp stored in
the sesssion and then set the actionForm's object timestamp to that...
WARNING: object: [EMAIL PROTECTED] timestamp:
1118701102377 lockertime
stamp: 0
org.exolab.castor.jdo.ObjectModifiedException: Invalid object timestamp
detected.
        at
org.exolab.castor.persist.ClassMolder.update(ClassMolder.java:2111)
        at
org.exolab.castor.persist.LockEngine.update(LockEngine.java:633)
        at
org.exolab.castor.persist.TransactionContext.markUpdate(TransactionContext.java
:1059)




What am I doing wrong here?




[EMAIL PROTECTED] 06/10/05 3:48 PM >>>


Trying to figure this out and I figure there is a way that is more
logical, can anyone help?

When saving an object to a session then, retriveing that object
through
struts as a ActionForm then doing an update I get duplicate rows.


ie...


I do something like
//get formObject


Database db = getDatabase();
db.begin();
/// get object here... select ....
db.commit();
db.close();

testob = getMyObjectForm();
session.setAttribute("here", testob);


/// then display the object via jsp


//on submit


testob = (aTestOb) form;

Database db = getDatabase();
db.begin();
db.update(scf);
db.commit();
db.close();

Results in duplicate objects obviously because the form object struts
is passing in, is not the same object as stored in the session. I have
done some testing of tring to retrieve the sesssion object on submit,
then setting that object's values exactly like the one passed in the
form. But this doesn't seem to appear to be a good idea either, and
didn't work at first when I tried it.

Eric

-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED] -------------------------------------------------


-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

--

Syscon Ingenieurb�ro f�r
Me�- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstra�e 11
D-72127 Kusterdingen
Germany

Tel.   +49 7071 3690 52
Mobil: +49 173 9630135
Fax    +49 7071 3690 98

Email: [EMAIL PROTECTED]
Web:   www.syscon-world.de

-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to