> Further, if BeanA and BeanB are executing in the same process, will the
> java.sql.Connection returned by the DataSource in BeanB.bar() be the
> same Connection object that is being used by BeanA?

The is the $64,000 question. The EJB server should return (or otherwise
use) the exact same connection for both beans if they are using the same
DataSource and and running inside the same transaction. At least that's
what you expect to happen and how we implemented it.

arkin


> What are the semantics if BeanA and BeanB are running in different
> processes?

If the JDBC driver supports true distributed transactions (and I have to
find one that does), then both connections on different processes, even
different machines, can share the same transaction. But not all EJB
servers are smart enough to figure that they should use the same Xid
branch (transaction identifier).

An EJB server could solve this problem very easily if it makes sure
BeanA only calls BeanB in the same process. There's clear semantics for
how this could be solved even across heterogenous EJB servers, but I
don't know many EJB server do that today.

arkin

>
> Did I just miss this information in the EJB 1.1 spec?  Or is the spec
> intentionally vague about this.  It seems to me that these semantics
> should be well specified (or at least identified as vague and
> non-portable).  The EJB 1.1 section on "diamond" transaction scenarios
> comes close, but doesn't fully address the issue.  In the scenario
> documented in this email, the account state is not cached... but instead
> is stored in a transactional resource.
>
> -eric
>
> ===========================================================================
> 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