Hi --

On Fri, 23 Jun 2000, David Regan wrote:
> If you are making a big query like this, regardless of pagination, the next
> time you request that data from the database it is likely to be in the cache
> assuming the user doesnt go for coffee in the meantime.
>
> Alternatively you could use an entity bean or other persistant singleton
> object to do this caching/returning subsets. All you would need to store in
> your
> HTTP session would be the index and the query object, and again access would
> be  quick assuming the entity bean didnt need to be serialized.

The approach I've taken has been to do a query that retrieves nothing but
keys for all the rows that need to be displayed (assuming that the data
view is not too complex), calculate which keys need to have full data
displayed on the current page, and then acquiring the full data for
those keys.  An obvious optimization.

> Of course I should probably follow that up saying that I haven't found a
> *good* case for Stateful session beans yet barring large transactional
> systems, so my
> opinion may be somewhat suspect.
>
> The classic example (Sun's shopping cart app) could be done quite easily
> using HttpSession data. It really amounts to the same (or less, since there
> is container overhead) memory requirements and less cpu usage (since you
> aren't having to serialize/deserialize and go through the ejb layer each
> time you query the data). This would be pretty important for any shopping
> app, since they typically need to handle a lot of concurrent sessions.
>
> Just my 2c,
> -David

Ummm, I don't really know what HttpSession data is, but it sounds
supiciously like something in a servlet engine.  How does this work
in a clustered environment in which a user might find themselves on
any of the cluster members, and need to have access to their session?
I think that's why StatefulSessionBeans (preferably persisted to a
database) are useful... does that sound right?

Cheers,

        Gary

> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of David Wall
> Sent: Thursday, June 22, 2000 9:05 PM
> To: [EMAIL PROTECTED]
> Subject: Re: HTTP Session Vs Stateful Session Beans
>
>
> > And a question... Are you trying to make this big query, and then split
> the
> > results to show a small amount of them in every 'screen'...
> > because if so, what you need is PAGINATION, that is, to be able to split
> > your big query into smaller querys (like altavista does to 'show' a
> million
> > hits... ten a page..)
>
> But is there really any good scheme for pagination with an SQL DB?  Some DBs
> have a LIMIT clause, but still there's a good chance the entire result set
> has to be retrieved before the subset is returned, unless the DB has nice
> optimizations and the WHERE clause is on an indexed field.
>
> David
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to