Prevent session timeout during database update

后端 未结 2 1403
囚心锁ツ
囚心锁ツ 2021-02-20 16:06

Background

A web application calls a stored procedure to perform an intensive database update. The relevant portion of web.xml was updated to four hours:<

2条回答
  •  感动是毒
    2021-02-20 16:46

    In my opinion, no user would want to sit in front of screen monitoring a background job for 4 hours. Few years ago, I had to implement report generation which took hours. the implemented solution was the following:

    • Generate the report in a background thread. The thread was monitored and available via application context List. The thread contained information about the owner and their progress.
    • Users can list their own threads and see progress.
    • Upon completion the report thread would store the report for offline access, send an email notification to owner with a link to download the generated report.

提交回复
热议问题