May be you can instantiate(will call ejbLoad) the dependable bean to
make sure its existant before creating the bean.


-----Original Message-----
From: Cedric Beust [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 31, 2000 1:08 PM
To: [EMAIL PROTECTED]
Subject: Re: Determining ejbStore call order


> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Alex Cachia

> I'm planning to use BMP Enity Beans.  The problem arises when the
> EJB Container calls ejbStore in a non-predetermined order.  This is a
problem
because my
> application needs to write to the repository in an order which will
> satisfy the validation rules.
>
> Any ideas how to get around this problem?  All that I can think of
> thus far is not to implement the ejbStore method and write to the
repository
from the
> applications business logic methods.

That would work but it would impose quite a burden on your business logic
methods.

How about "faking" stores and let a BMP bean, which you control, make the
final
decision ?

Each ejbStore() of your CMP beans logs some information on what it is
supposed
to store. This information might not be valid per your rules, but it's okay
since they don't go to the repository yet.

On a regular basis, ask your "Coordinator" BMP bean to pick the log, apply
the
validation rules and perform the write to the repository if the validation
is
successful, or logs some error/exception if they are not.

There are some big question marks about this approach though :

- the container might not like you pretending to ejbStore() when you
actually
don't. This might pose a problem for future re-activations.

- what happens when the Coordinator detects an invalid store() ? How can it
notify the initial bean (and its client) that its store could not be
successfully performed ?

--
Cedric
http://beust.com/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".

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