inline
> -----Original Message-----
> From: Dane Jones [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, April 15, 2001 2:39 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Basic Theory Question
>
>
> Thanks Dion for your quick response.
>
> However your answer is actually the very cause of my confusion.
>
> As far as I can tell, the ejbFind*() methods are called after the
> ejbCreate() is invoked. Is that correct?
No. Perhaps I could explain it this way.
There's an interface, the Home interface, that allows to manage a pool of
beans. It has methods to create a bean in the pool, to remove a bean, to
find a bean(and in the darkness, bind them ;-)
The pool usually is an RDBMS table.
Should someone INSERT something into that table, makes a new bean exist,
and can be looked up by the home interface.
The BMP implementation of a bean implements the home interface (ejbCreate,
ejbRemove, ejbFind*) and the methods of the bean itself, which I think is
the root of your concern; bottom line: you don't do a create then a find in
the same code block, but a create either a find. Of course, create -> find
is a sequence you use, but the create and the find are strongly separated in
time(you've lost any pointers to the bean you had, but you somehow know th
primary key).
> In that case, if cust
> already exists (I don't mean _cust_ per se, but the table row
> that will be
> used to fill the EJB's attributes) what's the point of an
> INSERT statement within ejbCreate() when it's already there and the
> ejbFind*() method can retrieve the existing record?
No point. If you have to connect to an existing, semantically inmutable set,
your ejbCreate method should return an exception and also have no
setPrimaryKey or such method.
>
> Does the ejbCreate() method *have* to contain an INSERT
> statement (for BMP)?
No. see above.
> And does the ejbRemove() method have
> to contain a DELETE statement?
No. see above
>
> I know I'm missing something quite logical, and this is
> making me feel quite
> stupid.
>
> Again, thanks for your help on this
>
> Cheers
>
> DJ
>
===========================================================================
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".