You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Matthias Laube <ml...@gmx.de> on 2004/05/05 14:18:58 UTC

rc6 ODMG Transaction checkpoint / flush bug / question

Hi ojb folks!

I'm using the OJB RC6 ODMG api to persist my objects, when updating an 
object I get the following behaviour:

obj = fetchObj();

case 1: lost update when calling checkpoint AFTER obj is locked by the transaction and BEFORE obj is changed.

tx.begin();
tx.lock(obj, WRITE);
obj.setX(obj.getX()); // obj is locked but unchanged
tx.checkpoint(); // or flush --> no update 
tx.lock(obj, WRITE);
obj.setY(newValue); // obj changed
tx.checkpoint(); // or flush() --> no update BUG?
tx.commit(); // no update in the db


The change by setY() is successfully persisted when:
1. When ommitting the first call to checkpoint.
2. When obj is not locked by tx before the first call to checkpoint.
3. When obj is locked AND changed before the first call to checkpoint.

Is this the correct behaviour? 


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


RE: rc6 ODMG Transaction checkpoint / flush bug / question

Posted by Eric DOUARINOU <er...@steria.com>.
hi,

We have similar problem after Tx.flush ! problem with ObjectEnveloppe ?
work around, you can use tx.markDirty(obj)

--
Eric

-----Message d'origine-----
De : Matthias Laube [mailto:mlaube@gmx.de]
Envoye : mercredi 5 mai 2004 14:19
A : ojb-user@db.apache.org
Objet : rc6 ODMG Transaction checkpoint / flush bug / question


Hi ojb folks!

I'm using the OJB RC6 ODMG api to persist my objects, when updating an
object I get the following behaviour:

obj = fetchObj();

case 1: lost update when calling checkpoint AFTER obj is locked by the
transaction and BEFORE obj is changed.

tx.begin();
tx.lock(obj, WRITE);
obj.setX(obj.getX()); // obj is locked but unchanged
tx.checkpoint(); // or flush --> no update
tx.lock(obj, WRITE);
obj.setY(newValue); // obj changed
tx.checkpoint(); // or flush() --> no update BUG?
tx.commit(); // no update in the db


The change by setY() is successfully persisted when:
1. When ommitting the first call to checkpoint.
2. When obj is not locked by tx before the first call to checkpoint.
3. When obj is locked AND changed before the first call to checkpoint.

Is this the correct behaviour?


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org