Concurrency Control in Clustered Web Application. Any pattern some one ?

From: Hugo Villeneuve <aerosteak_at_hotmail.com>
Date: 17 Jan 2004 17:22:45 -0800
Message-ID: <a93284e4.0401171722.7c2ef307_at_posting.google.com>



Hello
I need some guideline in implementing Concurrency Control in a Clustered Web Application.

We are in the process of building a web application and we are now facing some issues regarding data concurrencies. The application is a java J2EE running on 2 WebSphere App server in collocation mode (the session is not shared) and they both access a single Data Base. For me this is quite a typical setup and a typical application we are working on.

Here is my case :
Our web application managed "Clients Request". When a user of the application is editing information of a "Clients Request" we need to lock it to prevent another user from using it. Ironically there is not much information out there on how to efficiently implement this type of Concurrency Control.

First we added a field LOCK_BY to each "Client Request" to show which user is locking the request. When a user Logout of the application or when a Session Time-out occurs we unlock all requests locked by the user. Then there is problem if two different people login with the same user name. To address this issue we added another field, LOCK_UNIQUE_ID, and we store the Http Session ID to be able to differentiate the same user but on different Browser.

But then, what happens if a server goes down ? All locked requests will stay locked forever. Then we thought that we could unlock all requests when we start the Web Server. It will work well if we had only one server but we have more then one.

Looks like we are not on the right track. Is there a simpler way to manage Concurrency Control ? Any advice will be welcome. Received on Sun Jan 18 2004 - 02:22:45 CET

Original text of this message