-1

I have an ATG application running on a jboss as an App Server. The request-scoped component(bean) say CartManager has a method addToBag(...).

Since it has request scope my understanding is that its instantiated upon each request and the App Server guarantees that only one thread have access to that instance.

We're experiencing a concurrency issues so I just want to rule out one possible explanation.

Vladimir
  • 12,753
  • 19
  • 62
  • 77
  • The application server doesn't guarantee that. If for some strange reason you had multiple threads running to service a single request they could all conceivably have access to the request scope. What it guarantees is to keep request scopes apart from each other. – user207421 Apr 28 '16 at 20:27

1 Answers1

0

You are likely experiencing an issue with users double clicking on a button (quite common for the Add To Bag button). Within ATG there is a way to counter this and it is called the RepeatingRequestMonitor.

Essentially it keeps track of requests executing the current handler and either block or allow a subsequent request for the same handler.

In the shopping cart process it is already implemented in the PurchaseProcessFormHandler so if you extend this particular FormHandler you can use its accessor methods.

radimpe
  • 3,197
  • 2
  • 27
  • 46