Bug 301 : Optimistic locking without @Version ... use all loaded properties
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.7.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
25/05/2010
Updated 
25/05/2010
Type 
Bug
 
Attachments 
No attachments

Hi,

We noticed that when we do not use an @Version property for the
optimistic locking check, then ebean will only check that the olf
values of the changed property's are still the same in the database
(in the where clause).

So if some columns in the database row are changed by an external
process but not by ebean then we will not get an optimistic locking
exception.

Is there a property or setting to tell Ebean that it's not the only
one changing the database? So that it will include all property's?

Of course such a property should affect caching also (by disabling the
L2 cache?).

Btw, this is more a generic remark then something we need. As we found
a way to use an @Version timestamp property that is updated by both
systems hitting the database.

Rien

 
Rob 25 May 05:01
This is a bug really ...

There is an annotation @UpdateMode where you can set updateChangesOnly = true ... but really we should have the option of just setting the changed properties and using all loaded properties in the where clause (In my book that is really what we should do by default rather than the current behaviour).

... and no we can't do that at the moment. I log a bug for this.

Thanks, Rob.

Rob 25 May 10:47
Fixed in HEAD

fixed in HEAD.

woResponse

Upload a file