On 3 Apr 00, at 9:31, Laird Nelson wrote:

> Suresh Kumar Govindaraj wrote:
> > I want to write a query to get a large result set of customers, which I
> > will use for reporting. Can it be done using stateless session beans or
> > does the specs say I should use entity beans, for all data access?
>
> Don't use entity beans for large result sets.  They are too heavyweight.

In my opinion, this is very good advice.

>
> Well, I should say: don't use entity beans for large result sets if the
> number of concurrent users you expect to be using your system will be
> high.
>
> In general, for reporting-type problems, I'm in favor of just letting
> the database do what the database does best and hitting it with either
> (a) a stateless session bean if for some reason you absolutely have to
> use EJB technology or (b) hitting it with a regular JDBC query and
> extracting only what you want.

Potential problems with using a regular JDBC query from the client
include security exposure, the lack of connection pooling, and
dependencies in your client (e.g. reporting software) on the
database design.  These may or may not be applicable to your
situation.

A stateless session bean can solve these problems, but has
others of its own.  Simply returning a large result set from a
session bean method requires that the entire result set be
instantiated in memory at one time.  How big is your result set?
This could be a serious drain on server resources.  An earlier
suggestion on this list involved combining a) and b) to return a
ResultSet that could fetch data as needed; see Rickard's post of
March 4 in the archives for more information.

You might want to consider a different server-side technology for
your reporting needs, such as the servlet api, if Laird's (good)
suggestions are not applicable to your specific situation.

-Dan


Reporting applications are generally not
> very reusable (in our experience, anyhow) and often objectifying them
> doesn't buy you very much.
>
> Just MO.
>
> Cheers,
> Laird
>
> ===========================================================================
> 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".
>


------- End of forwarded message -------
------- End of forwarded message -------

===========================================================================
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