On Thu, 2007-07-19 at 15:13 -0700, Ben wrote:
> I'm reading the description of PREPARE TRANSACTION, and I see this:
> 
> "...its state is fully stored on disk, and there is a very high 
> probability that it can be committed successfully..."
> 
> What corner case reduces 2pc from "guaranteed" to "very high probability"? 
> Is the worry if somebody leaves transactions in a prepared state for 
> weeks, only to find that deadlock issues has arrisen at final commit time?
> 

You won't get a deadlock on COMMIT, because COMMIT doesn't acquire more
locks. 

The failure cases for a 2PC transaction are (as I understand it)
catastrophic. That means either the transaction can be committed, or you
probably need to restore onto new hardware anyway.

2PC is useful when multiple databases are involved and your application
crashes. When the application comes back you can look at the prepared
transactions and decide whether to COMMIT PREPARED or ROLLBACK PREPARED
based on the information in the other databases involved.

        Regards,
                Jeff Davis


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to