This is the fatal flaw in a two-phased commit.  As far as I know, a two-phased commit 
can never solve this problem (even though this is the problem it is apparently 
designed to solve).

It can come 'close' in a logical sense if everything but the very last possible atomic 
write is performed during phase 1.

However, it can never fully deal with transmission or media failures in the later 
parts of the phase 2 commits.  The whole point is that you cannot undo a commit.

If anyone else knows different, please speak up.

cc

"Kenneth D. Litwak" wrote:

> Ihav e some questions about the EJB spec saying that a container must support
> two-phase commit.  I know what a two-phase commit is. I owned code at IBM to
> do it for DB2/MVS.  What I don't understand is what the term "supports' means
> here.  Since the container isn't a database enginre, what items in a container
> have to vote on doing commit phase 2 during commit phase 1?  What's more, I
> can imagein all kinds of scenarios that essentailly make this notion useless.
> Trans 1 starts (CMT or BMT)
> Session bean method A is called
> Method A calls methods B, C and D of three separate entity beans, which map to
> two separate databases, Sybase and Oracle.
> The database updates are done,method A completes
> The container's TM calls commit on the transaction.
> This causes, I'm assuming, a commit call against both the Oracle and Sybase
> database.  The Sybase update succeeds (I worked there, so I have to tive htem
> some credit).  THe Oracle update fails.  Having th3 container do a two-phase
> commit here is totally irrelevant so far as I can see, since the TM cannot
> rollback the committed changes in the Sybase database.  The transaction can be
> rolled back, which might cau;se a rollback in Oracle, but Sybase is already
> committed.  It's too late.  So what good does it do to have the global
> transaction rolled back in a two-phase, container-level transaction?
>
> Ken
>
> ===========================================================================
> 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