I have an application, where in I have multipler servers (used for load-balancing). And the data is maintained in oracle and is pretty huge. As the application is vast, there are many performance-intensive transactions that take even 10 minutes to complete. Recently, we have been having issues where the same operation has been committed by multiple-users. Example,
a.) First user logs in and submits the process
b.) while the transaction is running, another user trys to do the same thing unknowing the fact that it is already running.
Can you please suggest me one best way to prevent this problem?
I dont understand how one user is so tightly coupled to the other user. Is it clustered servers ? in that case session migration is there and session variable is visible to other servers , but its costly and hence you got to minimize the variables in session.
Is that expected behavior ? Check if you use any instance variables , which is shared among threads , hence needs to be synchronized.
Joined: Aug 17, 2006
If it takes that long to complete request, better use a queue for the requests and process each one as they complete.
Hope it helps.
Joined: Mar 03, 2008
Thanks for the reply.
Actually yes, some times even the user who submitted first assumes that the process is not running correctly and re-submits it again. Or some other user submits the process.
Am not sure whether usage of synchronized will help here and nor the synchronized threads.
Actually, am thinking about a way to load the first user submit details in a xml and when second user submits, use JAXB to identify whether it is present and if present do not do it again.