Hi All,
Thank you for the links and for your thoughts on this.
The real reason we need Pessimistic locking is that we will have composite entities (ie main entities with their relations) being managed/edited for long periods of time (a customer with her accounts for example). A user might edit an entity continuously for one hour!
I wasn't planning on using row level locking at the database level because the overhead of spanning a transaction across multiple requests is too big and I am not sure I can implement it either!
I will probably build a locking service that either marks an entity as locked by adding a flag column or by keeping locks in separate tables. In any case, locks will be persisted but not managed by the database. I will probably use Optimistic locking for the Locking Service
I am mostly thinking of a classic checkin/checkout CMS like scenario.
I will have to build a number of workarounds to mitigate the stateless nature of the web, I know it and I am willing to do implement it.
In any case, I am off to build a prototype and see what happens.
Thanks again!
Chris