简体   繁体   中英

Can multiple threads in application server modify request-scoped component?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM