Andrew, It is possible to simulate synchronised access to two different servelets simply by putting samplers sequentially under the same thread. Forcing Jmeter to asychronously hit the two servelets in such a way as to simulate a race condition is much harder. The problem is that you can only 'ask' a thread to run, it is up to the operating system to choose when it will actually perform a given task.
We have similar issues with some of our software. The way that race conditions are avoided for us is to use MS SQLServer transactions to serialise access to shared data. To test that this is working, I use large numbers of threads sequentially hitting different pages (which shared data). The threads are 'ramped up' so that the best chance of race conditions is achieved. I am only happy that there are no race conditions when the test has run without data conflict for several hours. It is an inexact science - but it is all we have! Cheers AJ On Fri, 2007-02-09 at 13:08 -0800, maskkkk wrote: > I read in my Servlets book that you should synchronize data that is shared > between multiple servlets. > > An example of this would be if two servlets were to modify the user's > session object at the same time. > (Meaning that one user has 2 browser windows open accessing 2 different > servlets which are both modifying the same session object) > > Without synchronization it is possible that this may result in a session > object in an invalid state (since it is being modified by both threads) > > Is there anyway to recreate/test this functionality with JMeter so that it > may be tested? > > Thank you, > > Andrew J. Leer www.cubicalland.com www.nerds-central.blogspot.com

