I installed the Wicket + Hibernate + Spring web application, which includes collecting some data (with some files generated and returned), storing this in a database, creating some images and displaying all of this on a web page.
All this works great for short runs, but sometimes data collection (which is associated with some removal of headliners) takes too much time (20+ minutes) and waiting time. I tried to resolve this using two approaches, but both of them show some problems.
The first approach was to use AjaxLazyLoadPanel and just did everything in getLazyLoadComponent. This worked fine for short runs, but for the 20 minute launches the LazyLoadComponents did not load (a good oxymoron there) due to timeouts.
The second approach involved creating an intermediate fragment with added AjaxSelfUpdatingTimerBehavior with a duration of 10 seconds, which was polled for files that are created when the number is crunched. It seems that tasks are running in the background without problems, but fail when the returned data needs to be stored in the database. I am using the Open Session in View template, but maybe this fails when I try to save the data after 20 minutes? (The solution may be to resolve this issue.).
Due to the above issues, I am currently reading alternative approaches for handling these lengthy tasks and have come across them:
Now I'm wondering if any of them can be better suited to solve the timeout problems that I have when starting tasks and storing data in a database, or if someone has other solutions that can help in this situation.
I would really like to know if the new approach is effective before I spend another day trying to prevent something from working.
Yours faithfully,
Tim
java hibernate timeout wicket
Tim
source share