Multi-Threading

A

Alan T

Just wanted to know if I can do this:

1) User click a button on a page
2) It creates a thread
3) The thread will generate a report
4) This process may take up to a couple of minutes. eg. 5 minutes
5) Before the process finish the client exit and close the browser
6) The process will still keep doing its job until the report/file is
generated

Do you think it is possible?

The reason I am think of this way is the user does not need to wait for the
5 minutes keep the browser opening in blank mode.
 
R

Registered User

Just wanted to know if I can do this:

1) User click a button on a page
2) It creates a thread
3) The thread will generate a report
4) This process may take up to a couple of minutes. eg. 5 minutes
5) Before the process finish the client exit and close the browser
6) The process will still keep doing its job until the report/file is
generated

Do you think it is possible?
It is possible to do but what happens to the report after it has been
generated and the client-server connection no longer exists? If the
report gets written to some datastore for later retrieval, you're
adding some unnecessary complexity. Just have the web app hand the
request off to service that writes the generated report to a datastore
which is visible to both the service and web app.
The reason I am think of this way is the user does not need to wait for the
5 minutes keep the browser opening in blank mode.
If this _has_ to be done in browser in real-time I would consider
using an asynchronous request. Even so 'couple of minutes' will seem
like an eternity to the user.

regards
A.G.
 
A

Alan T

Just wanted to know if I can do this:
It is possible to do but what happens to the report after it has been
generated and the client-server connection no longer exists? If the
report gets written to some datastore for later retrieval, you're
adding some unnecessary complexity. Just have the web app hand the
request off to service that writes the generated report to a datastore
which is visible to both the service and web app.

I just wonder if there is a 'global' thread can be created, does not attach
to any 'session' or user connection.
Can this 'global' thread be created outside the web page (eg. outside
mainpag.cs), such as in GlobalThread.cs?

If this _has_ to be done in browser in real-time I would consider
using an asynchronous request. Even so 'couple of minutes' will seem
like an eternity to the user.

Yes, this is another option I am thinking of.
I will create a table storing the report request from the web page, eg. has
table fields:
ReportName
ReportParameters
ClientName
DateRquested

Then write a windows service that continuously scan through this table to
generate the requested report and save to harddisk.
 
C

Cubaman

Just wanted to know if I can do this:

1) User click a button on a page
2) It creates a thread
3) The thread will generate a report
4) This process may take up to a couple of minutes. eg. 5 minutes
5) Before the process finish the client exit and close the browser
6) The process will still keep doing its job until the report/file is
generated

Do you think it is possible?

The reason I am think of this way is the user does not need to wait for the
5 minutes keep the browser opening in blank mode.

I think that you should try Sql Reporting Services. It comes with Sql
2005 for free, and can generate reports in push or pull mode.
http://technet.microsoft.com/en-us/library/cc917530.aspx
Best regards.
 
A

Alan T

Hi,

Unlucky, as we are using MySQL as backend.

Also a question in my situation:
- we got 80 reports
- each report have different parameters (filters, may be 4 or 5 filters)
- for my second option (write a Windows service scanning through the table)
- if I store each type of report request in its own table, there will be 80
tables with one master table(the queue) which points to each possible report
table (one of those 80 tables)
- if I use 1 big table as request queue, there will be about 30 fields
storing the parameters (many of the parameter fields will be empty, first
normalisation, but I don't mind this)

Just wanted to know if I can do this:

1) User click a button on a page
2) It creates a thread
3) The thread will generate a report
4) This process may take up to a couple of minutes. eg. 5 minutes
5) Before the process finish the client exit and close the browser
6) The process will still keep doing its job until the report/file is
generated

Do you think it is possible?

The reason I am think of this way is the user does not need to wait for
the
5 minutes keep the browser opening in blank mode.

I think that you should try Sql Reporting Services. It comes with Sql
2005 for free, and can generate reports in push or pull mode.
http://technet.microsoft.com/en-us/library/cc917530.aspx
Best regards.
 
C

Cubaman

Hi,

Unlucky, as we are using MySQL as backend.

Also a question in my situation:
- we got 80 reports
- each report have different parameters (filters, may be 4 or 5 filters)
- for my second option (write a Windows service scanning through the table)
- if I store each type of report request in its own table, there will be 80
tables with one master table(the queue) which points to each possible report
table (one of those 80 tables)
- if I use 1 big table as request queue, there will be about 30 fields
storing the parameters (many of the parameter fields will be empty, first
normalisation, but I don't mind this)







I think that you should try Sql Reporting Services. It comes with Sql
2005 for free, and can generate reports in push or pull mode.http://technet.microsoft.com/en-us/library/cc917530.aspx
Best regards.

Dont store reports in ddbb, but in file system. Just save the path an
other relative data in ddbb. Is the most common aproach.
Best regards.
 
A

Alan T

Also a question in my situation:
- we got 80 reports
- each report have different parameters (filters, may be 4 or 5 filters)
- for my second option (write a Windows service scanning through the
table)
- if I store each type of report request in its own table, there will be
80
tables with one master table(the queue) which points to each possible
report
table (one of those 80 tables)
- if I use 1 big table as request queue, there will be about 30 fields
storing the parameters (many of the parameter fields will be empty, first
normalisation, but I don't mind this)

Dont store reports in ddbb, but in file system. Just save the path an
other relative data in ddbb. Is the most common aproach.
Best regards.


Hi,

Yes, I saved the exported reports in file system in .pdf format.
What I will save the report requests in table.

eg.
Master table:
ID
RequestUser
RequestDate
RequestReport ID
HasSaved
HasStarted

Detail report request table:
ReportID
ReportName
EmployeeID
Start Date
End Date
.......
.......
Filter30

So as each report will have about 4 filters (eg. DateFrom, DateTo,
EmployeeID, ...etc)
Most of the Filters fields will be empty.

My service will scan through the master table to see if any of the requests
had started and saved., set a flag if yes.
Then look for the details table for the filters and generated the report.

eg.
Generate Employee report, will take the EmployeeID, Start Date and End Date
for the report filters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top