In the event of the updates to the database, how do those changes get
reflected in the vector cache? Thanks - Satish

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Jaganathan Jeyapaul
Sent: Tuesday, September 28, 1999 1:28 PM
To: [EMAIL PROTECTED]
Subject: Re: Caching resultset at the server side..


Hi John,

Your technique seems good.. I assume that when you talk about the vector
that stores the resultset, you mean a custom object that wraps the resultset
and gets stored in a Hashtable as value, with the hashed SQL statement as
the key. Cool.. How do you activate purging in your servlet ? do you have a
low priority thread that polls at periodic interval to check for redundant
information in the hashtable ?

Thanks for sharing the details.

jagan j


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of John
Overland
Sent: Monday, September 27, 1999 9:41 PM
To: [EMAIL PROTECTED]
Subject: Re: Caching resultset at the server side..


Jagan,

We had a similar problem and have implemented 3 different pieces to solve
the problem which so far is working quite well.  The 3 pieces are as
follows:

1) ConnectionPoolServlet - Gets X number of connections to the DB, 5 to
start, grows if needed.

2) VectorTableServlet - Stores resultsets if desired with HASHED SQL
Statement as the key.

3) QueryServlet - HASH's the SQL statement and checks to see if it exists in
VectorTable, if not it gets a connection, performs the query and if flag is
set stores it into the VectorTable.

The result from any SQL query is a Vector which you can start displaying at
any point to any point.

We have set a purge flag in the VectorTableServlet to drop the resultset
after X time (5 minutes) of inacivity on that particular query or to keep it
permanantly.  The end result allows us to do the following.

1) SQL queries without storing the result (Live DB views).
2) SQL queries which store the resultset which provide 5 major benefits.
        a) Incredible (subsecond) responses with multiple users asking for
the same info.
        b) Ability to traverse the returned data everyway imaginable.
        c) Ability to sort resultset on any column. (Vector Sort)
        d) Ability to sub-search resultset (drill down). (Vector Search)
        e) Create permanent queries which is like on the fly system
variables.


As far as the number of records we have had in the VectorPool at any given
time the maximum we have seen is around 40,000.  The problem we had in
getting it higher was that each new query had to be different otherwise it
returned an existing set and add to that the 5 minute timeout, it was tough
to keep it that high. Our vectors typically have 10-12 (20 char) fields and
1-2 (200-2000 text) fields returned. Typical Vector size hovers between 500
& 5000.

John Overland
Nortel Networks
____________________________________________________________________________
______________

> > Hi All,
> >
> > I am fetching thousands of results from the database based on user
query.
> > But i need to show just few of them to the user and cache the rest at
the
> > server side. If the user wants to see more results then the cached
> resultset
> > should be queried and served to the user..
> >
> > my question is what is the rightway to cache information (fetched from
> > database..) at the server side..
> >
> > Could someone me suggestions or pointers to the right direction..
> >
> > I am using JSDK 2.1 / WEBLOGIC / JDBC.
> >
> > Thanks in Advance..
> >
> > ==================
> > Jagan J
> > Java Consultant
> > ==================
> >
> >
>

___________________________________________________________________________
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

___________________________________________________________________________
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

___________________________________________________________________________
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

Reply via email to