- It's better not to start threads from within your servlets. This is
not a good practice. Servlet container is a controlled environment.
- If you want multiple users to access these results, keep the results
(not the resultset, but an extract of results from the resultset) in
the context and not the session.
- Thirdly, see if you can build an RMI server to do the database access
including result caching. Since this RMI server will run outside the
container process, you can have daemon theads to fetch the results from
the DB, and update the cache. All your clients (servlets) can fetch
results from this server.
Regards,
Subrahmanyam
pradeep wrote:
>
> Hi All
>
> I would like to take ur help in solving this design related problem :
>
> I have to design a system which enables accepting the applications online
> and processing them
> in the back end by staff people. First , I am storing all the coming
> requests into a database using
> Java Servlets. Now I want to show these requests to staff people as a list
> on the browser.
> I am thinking of implementing this also in Java servlets. The number of
> incoming requests per day is
> around 100. Thus with in a week time , the total number of records are
> reaching thousands.
>
> Here is the point on which I want the clarification:
>
> 1.In my servlet , I don't want to access the database and create the list on
> each request. This will
> hit the performance, I will be having duplicate result sets(Number depends
> on the number of staff people) in the memory. What I want to have is a
> "single updated result set " shared by all the staff people.
> This could be done probably by declaring the "result set" as instance
> variable. But How can I keep this "result set" updated without processing it
> in the "service" method.The probable solution could be there should be a
> "Daemon thread"(seperate from the http threads) which shall be accessing the
> database in regular intervals and keep updating the "single result set".Is
> this correct solution to implement?will it not hit the performance, which is
> already running many "http" threads?
>
> 2.Also I have the interface which allows the staff to view the lists,based
> on 2 options :
> option 1) Time - past 10 days, 20 days, 1 month, all
> option 2) Number of rows per page - 20,40,60,80,100,
>
> I think If I can have a "single result set"(kept updated out of the
> "service" method), then I can
> put my page display logic in the service() method...
>
> I would appreciate if anybody could give me hints in clearing my doubts....
>
> thanks & regards,
> -pradeep
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
----------------------------------------------------------
Letting U=Universal, and given God=U and Unreason=U,
Unreason=God --- Q.E.D.
Check me at http://www.Subrahmanyam.com
----------------------------------------------------------
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html