cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <>
Subject Re: [RT] Direct Form->SQL mapping through OJB and DynaBeans
Date Fri, 31 Oct 2003 17:29:29 GMT
Hunsberger, Peter wrote:
> In general, this moves the responsibility for locking up a level which
> isn't something I'd care to code, but if you're going to use JDO I
> believe you'll just get a last change wins result anyways, which is how
> you could manage this...

If you implement this strategy, pretty soon you're going to end up with 
lost updates: Bob reads a record, Alice reads the same record, makes 
some changes and commits them, Bob makes some changes and commits them, 
overriding all of Alice's changes.

To solve this problem, you need to implement an optimistic locking 
strategy using version fields. Bob would not be able to commit his 
changes because the version number he retrieved does not match the one 
stored in the database because Alice incremented it.

I know Hibernate handles this, don't know about JDO.


Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail:

View raw message