This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes Synchronous and Asynchronous Report generation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Synchronous and Asynchronous Report generation" Watch "Synchronous and Asynchronous Report generation" New topic
Author

Synchronous and Asynchronous Report generation

Karan Jain
Ranch Hand

Joined: May 30, 2007
Posts: 82
Hi,

I want to generate a report which can have a million records pulled from the database. I want to display the report in synchronous ( if the user asks for the report, I should show it on the screen) and asynchronous way (we can send an email or any other notification after we generate the report in the background).

My questions are:
1) What is the good strategy to do this task?
2) What considerations I need to make for it in terms of database and other resources.

Any inputs are appreciated.

Thanks and regards,
Karan
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3268

Hi Karan,

Well firstly if your report can return up to a million rows, I'd certainly look at making sure that performs well, especially if you are planning on offering the result synchronously!

In order to have the report generated asynchronously and made available to several other requesters you'll want to look at kicking off a separate thread to perform the work and store the result somewhere for later retrieval.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Synchronous and Asynchronous Report generation
 
Similar Threads
JMS: Listener to Receive Messages From MQ Server ( Request Queue)
MDBs are not necessarily asynchronous, are they?
Different Message Exchange Pattern interfaces
how to maintain reference to the response object
Asynchronous web service client