On Fri, 3 Mar 2000 14:41:30 -0800, Assaf Arkin <[EMAIL PROTECTED]> wrote:
>IF you use a session bean, it must load all the records, serialize them
>and return a serialized copy. So you get the overhead of serialization
>(which is pretty significant) and you don't benefit from the value of
>fetch buffers (which gives bettern response time).

Not necessarily. You may use RowSet's to return data to the client that has
not been pre-fetched. See the RowSet tutorial on the JDBC site for details:
http://java.sun.com/products/jdbc

With this approach there is no overhead, but the details of database access
is hidden for the servlet, which only needs to access the session bean in
order to retrieve the data.

Far-out idea:
Wouldn't it be great if it was possible to have some methods in an EntityBean's
home interface which looked like this:
RowSet getDisplayData()
which could get a RowSet from the database containing data for display.
Since it is accessed through the Entity home interface the container could merge
data from the db with cached data, or even store cache to db before accessing
the db (either strategy will provide an up-to-date result).
This will allow us to have all the benefits of EntityBeans together with the
benefits of straight-JDBC non-pre-fetched data access.

(One would also want to define which fields are available in the returned
RowSet, and also what criteria the data should conform to. Like a finder.)

Comments? 8-) Am I missing something, or would it really be doable?
If this is possible, could someone please forward it to the EJB2.0 group!

/Rickard

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