0

I have a huge data that has to be displayed in a page retrieved from database table. The table is regularly updated with new data and page has to display the latest data whenever refreshed. Since, the page is loaded with heavy loads of data it takes time to load (2-3minutes) and sometime it suffers from only displaying white page.

So, what I need to do is create a temporary file in server which stores this data from database and the page will extract info from this file. This file should be reloaded with new data in each 10-15 minutes so that till 15 mins page displays the old data but after 15 minutes if page is refreshed it shows the new data.

Hope my problem will be solved with the above idea but I am only limited to above theory. Please provide me solution how it can be done and any other better idea than the above. if any java code sample that would be great to solve my problem.

Thanks

Madan Madan
  • 674
  • 1
  • 11
  • 28
  • Its not clear what you have difficulty with. Is it that you don't know how to use files? How to store/read your data in/from a file? How to run a task every 15 minutes? – Peter Lawrey Oct 03 '12 at 10:23
  • Hi Peter, I am having problem to display the data in a page. The temporary file is only my idea so that it becomes fast as page has to read from file and not from database. The campaign Table holds how many successful bills occur for which campaign advertisement. We have 20 campaign advertisements for which more than 50,000 bills are sent. The page displays campaign Advertisement, Bills sent Total, Users, Success Bills, Failed Bills.. This table is populated heavily and when page requests to retrieve data it is very slow. So, what can be the solution and how it can be done? – Madan Madan Oct 03 '12 at 10:42
  • Ok, so that's not what I thought at all and the use of a file really doesn't have anything to do with how you page data to a GUI or web interface. Do you have a Java GUI or a web application? – Peter Lawrey Oct 03 '12 at 11:22
  • @peterIt's a web app on Apache Tomcat. The main problem is there are more than 50000+ data which should be displayed at once in a jsp page. The data are updated in database regularly. For example At 2012-10-03 11:00 Google Campaign has 10000 advertisement with 3000 clubs and having 4000 successful bills At 2012-10-03 12:00 Google Campaign has 15000 advertisements with 4000 clubs and have 6000 successful bills The database table is populated with these data and becomes heavy weight. So, jsp page takes too much time to load. So, need a solution for this. Thanks – Madan Madan Oct 03 '12 at 16:36

1 Answers1

0

Now you are propably using a lightweight webserver (guessing from the fact you are talking about pages loading white)

But if were using some java ee application server like glassfish, you could have a scheduled task running every 15minutes that loads the data and stores it into a file.

http://docs.oracle.com/javaee/6/tutorial/doc/bnboy.html

Maybe Quartz is the answer for you: Scheduled task in a web application?

Or maybe you are not using a webserver/appserver at all and my answer completly invalid.

Community
  • 1
  • 1
Aksel Willgert
  • 11,367
  • 5
  • 53
  • 74