简体   繁体   中英

Java application can not serve two requests simultaneously

I have a single java application, where clicking on a button a report is generated which is heavy(around 30 mb excel report).

Before clicking on the 'generate button', there are two text fields which determines how much data you want(item id from: and item id to:).

Now the issue is when two simultaneous requests come requiring all the data, then who pressed the button first the report generates only for him and the other user gets empty report.But if one user requires full report and other user wants some of its information say 1000 rows , then both the users get their reports full of information.

Please give me some insight about where to look into and how to solve this problem. Thanks in advance.

There is a Singleton / application wide / Servlet Context wide stored information about the reports. It can be in the web layer, the report calling layer, or in the report generating layer. Actually both request set this data, and both report generations read this data, that's why it makes confusion.

Have a look at the structure of your application, try to figure out, where it can be. It would be useful you could describe the whole process of report generation, maybe you could realize it yourself, if you go through from the beginning.

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