Hi,
I am new to ejb and have a couple of questions about using Entity beans. I
have read the archives with some saying session beans should always wrap
entity beans and others saying that its okay to directly use entity beans.
I just wrote my first entity bean called Product using CMP and a test class
to make sure it does what its suppose to and it does except the performance
is terrible. Using a sql profiler I can tell that for every getXXX() method
that is called, there is a separate database call that is reselect all the
fields in the bean. Is this suppose to happen and if so how can I control
this behavior so that calling 5 getMethods does not create 5 database hits.
I am using TX_Required as the default for the bean.
Another question and I think that it may be related to the 1st is the notion
wrapping entity beans with sessions. Surely its is not suggested that all
the get and set methods of an entity be replicated on the session. An while
it may be necessary to use session beans to control the interaction between
several beans, there are often situations where you need to do a series of
gets on a bean to show the user. So how do we achieve this.
I have reviewed the sample at
http://www.execpc.com/~gopalan/java/session.html notice that he provides a
method like getProduct() which would return a reference to the product
interface (which is really an entity bean).
In this situation would the object be passed by value or would it be a
remote reference to an entity bean? would you still be able to do get an
sets on this object and use it like an entity bean?
Thanks in advance for your help and appolgize for the newbie nature of the
questions.
Tom
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
===========================================================================
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".