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 unique constraint on > "referenced table name, referenced object id" so that a object can not > be locked twice. > > On server side you can then implement methods like > Lock.create(CommonEntityInterface object), > Lock.delete(CommonEntityInterface object) and maybe > Lock.isLocked(CommonEntityInterface object) where > CommonEntityInterface is just an interface (or an abstract entity base > class) implemented by all your entities so you can call getId() on > them. The table name can be accessed via the @Table annotation > (reflection) or has to be generated if you use JPA default table names. > > -- J. > -- Why not use a set transaction statement that locks the desired row? Isn't that why we use a DBMS?
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
