Cedric,

Sorry to get into a little vendor war.  I'll try to keep
things down in the future (and expect to fail miserably ;-)

As evidence of my contrition, I thought to send this peace
offering:

If I read your posting correctly, I think this would indicate
a bug in your current CMP design.  While I understand that if
you take the idea of lazy loading to its seeminly logical extreme,
it appears that ejbLoad can be a noop, and defer the loading of
fields until the first getter is called.  However, this is not
true.

Consider the user has a handle to an Entity bean.  Now, consider
that there exists a method on this Entity bean which is executed
without ever calling any getter or setter methods (arguably a
stupid method to put on an Entity bean, but not illegal).  Now,
consider that someone snuck into the database and deleted the
given Entity record, unbeknownst to the container (maybe this
was done in a concurrent call to another container).  In such a
case (with a noop ejbLoad) a call to this method (which omits
getter/setters) will not detect that the entity does not actually
exist in the database.  That is, the call will not result in a
NoSuchObject exception, although it should.

In short, I believe that ejbLoad must always check the existence
of the record in the database (assuming you are not using an
exclusive mode cache).  If you have to go to the trouble of
checking the existence, then your might want to load in a subset
of the fields.  Hence, ejbLoad is not a noop, but instead...
(I'll stop there, and not go into the details our EJB 2.0
implementation).

And now I'll get back to work, and try to refrain from telling
other vendors whether they should piecemeal release their products
or not ;-)

-jkw

Cedric Beust wrote:
>
> > -----Original Message-----
> > From: A mailing list for Enterprise JavaBeans development
>
> > With the EJB2.0 spec, there is now support for container managed
> > relationships for Entity Beans. I wonder how these relationships are
> > restored when I load a bean. For example one-to-many relationships, are
> > all the relationships from one bean to the other beans created when I
> > load the one bean and then stored in a collection? Or is this done in a
> > lazy loading way, only restoring the relationships when they are used?
>
> This is vendor-dependent, but it obviously makes sense to lazy-load the
> relationships, and also all the container-managed fields in general (i.e. in
> Weblogic, ejbLoad() is a no-op).
>
> --
> Cedric

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