At 06:21 26.01.00 , Nicholas Whitehead wrote:
>I have been evaluating an architecture for a system we
>are building and considering the issue of optimizing
>database access with entity beans.
>
>It seems to me that entity beans are ideal in
>situation where one is issuing transactions against
>discrete objects in the database. Consider a system
>that manages a users widgets.
>
>If a user needs to lookup a single widget and submit
>an update to that widget, the actual SQL that is
>submitted to the database, a SQL SELECT and a SQL
>UPDATE can, on theor own, be reasonably efficient.
>
>However, I am concerned about situations where I need
>to provide a user a list of their widgets. If each
>individual widget bean issues a SQL SELECT in order to
>create itself, I will have n SQL SELECT statements to
>execute against the database.
>
>Contrast this with issuing one SQL SELECT statement
>that will return n rows and instantiating n objects
>for each row returned. This is inherently more
>efficient from the database perspective, but I am
>unsure as to whether this model can be implemented in
>EJB.
>
>Any thoughts ?
Hi,
this is a problem that has been discussed in great detail on this list so
it's worth searching the archives. If I understand you the main problem is
that you want to present the list of widgets to the user (in some kind of
ui) to choose one to edit. One common thing to do in these cases is to have
lightweight representation objects that can be constructed by an SQL query,
that contain the primary key of the entity they represent and use entity
beans once the user has chosen one to edit because as you stated, entity
beans are reasonably efficient if your really just manipulating one
database record. one thing I would really look at is the requirements of
your system. in many cases I have seen the performance of a well optimized
cmp engine might be ok for using entity beans directly. it just doesn't
scale well but if you know that you only expect a certain number of
concurrent users, you might want to give it a try. It has saved me lots of
work (especially in prototyping) so far.
regards,
robert
(-) Robert Kr�ger
(-) SIGNAL 7 Gesellschaft f�r Informationstechnologie mbH
(-) Br�der-Knau�-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de
===========================================================================
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".