Somehow I'm not satisfied with this answer.

 If the EJB is supposed to provide a mechanism of factory/locator/home class
that is responsible for finding "objects" with a specific state - then
either the mechanism needs to do it's job properly or should not be provided
at all ( maybe with a clear disclaimer :-) so that developers know that the
responsibility of not using "out of date" data lies on them.

It's easy for developers to start using finders extensively in all kinds of
methods hidden withing other method calls. It's dangerous that depending on
when a method is called, the result "may" be incorrect.

Looks like one needs to be very careful with finders.

> There can be no other solution,

I thought I spoke to some vendor - maybe Persistence and they were handling
this by executing a finder - then checking their in-memory list and pushing
the list on top of what was retrieved from the database and reapplying the
query on those few in-memory beans pushed into the new list. Doesn't seem
very expensive or difficult - but then I'm probably being naive.


Sachin.



>since the entity beans may
> use bean-managed
> persistence.  To provide the behavior requested of the finder
> method, the
> container will have to call ejbStore after any entity bean
> method is invoked,
> possibly many times on the same bean instance within the same
> transaction.  This
> will end up executing multiple SQL update statements on the
> same records within
> the same database transaction.
>
> In my opinion you are making an application design decision
> that involves
> tradeoffs.  You are utilizing a feature provided by your
> particular server
> vendor to allow your code to work given a particular
> application design.  You
> are potentially trading off portability and definitely
> trading off performance.
> That doesn't mean it is a bad decision, just that the
> decision has consequences.
>

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