Rickard �berg wrote:

> Hey
>
> Charles Paclat wrote:
> >
> > Ian Mcallion wrote:
> >
> > >-Not so. Two transactions concurrently accessing the same logical entity
> > >bean instance will get two in-memory copies of the instance.
> >
> > Is this in the EJB spec, or is it an implementation detail?
>
> The generic answer:
> The EJB spec. defines the contracts between the clients, the beans and
> the containers. Any implementation that follows these contracts is a
> "compliant" implementation.
>
> The specific answer:
> This is an implementation detail, and it is shown in the spec. as an
> example of a possible interpretation/implementation. Some servers may
> choose to do it this way, while other may choose to serialize calls to
> one instance. Which is the best is completely reliant on the particular
> application. If the degree of contention in the application is high, a
> instance-per-transaction implementation would be recommended, and if not
> then a single-instance implementation would be recommended.

Serial reuse of the same instance would adhere to the principle that there are
never two threads executing in the same instance at the same time. It would be
equivalent to use of pessimistic locking with exclusive locks even for read-only
access so would be an unsatisfactory designpoint for a server. I suppose it may
be a useful deployment option in some bizarre situations!

Ian McCallion

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