Il giorno lun, 21/01/2008 alle 20.09 +0900, James Henstridge ha scritto:
> > IMHO, it should raise an error if the transaction was started for
> > two-phase. Otherwise I don't see any reason for (1).
>
> I disagree here.  If a problem is detected early in the transaction,
> calling prepare() before rollback() on the other members of the global
> transaction is a waste of effort.
>
> As for commit(), the transaction manager can use one-phase commit for
> the last resource without integrity problems.  I don't see much value
> in preventing this optimisation.

I agree on rollback(), not on commit(). If the transaction manager wants
to use one-phase it should do that explicitly. Allowing to call commit
on a two-phase transaction without first preparing it is prone to errors
and can lead to subtle errors like depending on it creating a "standard"
transaction on some backends and not on others. 

federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                [EMAIL PROTECTED]
INIT.D Developer                                           [EMAIL PROTECTED]
 When people say things are a lot more complicated than that, they
  means they're getting worried that they won't like the truth.
                                                    -- Granny Weatherwax

Attachment: signature.asc
Description: Questa รจ una parte del messaggio firmata digitalmente

_______________________________________________
DB-SIG maillist  -  DB-SIG@python.org
http://mail.python.org/mailman/listinfo/db-sig

Reply via email to