> -----Original Message-----
> From: Jean-Baptiste Nizet [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 17, 2000 11:53
> To: [EMAIL PROTECTED]
> Subject: Two phase-commit: when is it needed?
>
>
> Hi all.
>
> It's not clear to me when 2PC is actually needed in order to
> have all updates in
> a transaction committed or rolled back.
> Obviously, 2PC is required when a single transaction performs
> updates in two
> different databases.
> But what about a transaction spanning across several beans in
> different servers?
> Is 2PC really needed in that case, or is it possible to have
> atomic updates
> without 2PC.
>
> Inprise doc mentions that 2PC is needed : from
> http://www.borland.com/devsupport/appserver/faq/Transactions_a
> nd_JDBC.html,
>
> "Be careful to avoid the following scenarios:
> 1) Access to multiple DBs within the same global transaction.
> 2) Access to the same DB from multiple EJB servers in the same global
> transaction.
> Both of these scenarios depend on 2 phase-commit support,
> which is not available
> via JDBC 1.x at this point."
>
> On the contrary, Weblogic doc
> (http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_environm
> ent.html) says:
> "Although WebLogic Server does not support transactions that are
distributed
> over multiple datasources, a single database transaction can span multiple
EJBs
> on multiple servers. This can be accomplished explicitly by starting a
> transaction and invoking several EJBs. Or, a single EJB may invoke other
EJBs
> that implicitly work within the same transaction context."
>
> So, is Weblogic incorrect, or have they implemented a smart transaction
engine
> that allows this feature? Is it even possible?
It is possible by having a Proxy java.sql.Connection perform all operations
via
the first connection opened to the database. This way, only a single actual
connection is ever used per transaction, and of course this connection is
made
from a single server (the one that started the transaction), and 2PC is not
needed.
I don't know if weblogic does it this way or not.
- Avi
--
s/\be(\w+)/e-\1/g;
===========================================================================
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".