Re: Aw: Re: Entity version checks / optimistic locking

2011-07-06 Thread Jeff Chimene
On 07/06/2011 09:39 AM, Jens wrote: > That would imply that a transaction has to live longer than one request > (if you use JPA you can only lock an entity inside a transaction and the > entity will be unlocked once you commit or rollback). OK > But I think in > most common ajax web applications

Aw: Re: Entity version checks / optimistic locking

2011-07-06 Thread Jens
That would imply that a transaction has to live longer than one request (if you use JPA you can only lock an entity inside a transaction and the entity will be unlocked once you commit or rollback). But I think in most common ajax web applications you do one transaction per request and that way

Re: Aw: Re: Entity version checks / optimistic locking

2011-07-06 Thread Jeffrey Chimene
On 7/6/2011 1:48 AM, Jens wrote: > You have to store the lock somehow in the database. For example you > can create a database table called "locked objects" that has columns > like "id, referenced table name, referenced object id, user id that > locked the object, date of lock". Then you put a uniq

Aw: Re: Entity version checks / optimistic locking

2011-07-06 Thread Jens
You have to store the lock somehow in the database. For example you can create a database table called "locked objects" that has columns like "id, referenced table name, referenced object id, user id that locked the object, date of lock". Then you put a unique constraint on "referenced table nam