Please use the google group to ask questions - thanks.

by Manuel 22 Feb 09:54
Support object versioning for optimistic locking

Versioning is a simple solution to the locking problem in a distributed/disconnected system - it has some drawbacks in highly concurrent application, but overall I have found it to be simple and powerful. In essence a column is added to the table with a sequential number i.e 1, when the object is read it includes this number, each save will then include the version "update X set version = version +1 where version = valuereadinobject", if update count is zero throw a concurrent modification exception.

It could be be an optional field at object level as it only makes sense for use where you need locking i.e updating account balances. I would love to see support for a version column type in ebeans. This is really the last required component for adoption of an otherwise brilliant framework.

I actually use Hibernate in the ebeans model currently, i.e work with pojos then have an entity manager with an 'update' method that does a: load, set properties of hibernate object to pojo values, and then commit.

22 Feb 20:58
by Rob

Perhaps I miss something... but Ebean already supports @Version and you can put that on a int/long/Integer/Long field as a counter or a timestamp field. (Just like JPA)

... so this is already supported?

Am I misunderstanding?

26 Feb 20:10
by Manuel

Ahhh, great - looked everywhere in the documentation, but couldn't find it! The password reset button does not work on the forum login page.

Create a New Topic

Title:
Body:
 
Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse