On Mar 20, 2007, at 11:52 AM, Michael Bayer wrote:

> however, this is not using two phase commit, which means that if one
> commit fails, all previous commit's stay committed.  if you want true
> two phase commit I'd look into Zalchemy which has this feature.

actually i should correct myself - technically the commit strategy  
inside of SessionTransaction is more or less equivalent to what  
Zalchemy is doing right now - when you say trans.commit(), flush()  
will be called on the underlying session which will issue SQL to all  
involved databases.  *then* it will go through and commit each  
database individually.  since all SQL has been issued, its usually*  
the case that any exceptions that would have been raised have been  
raised already, and the commits are guaranteed** to succeed.

* if you have your database set up to defer constraint checking until  
commit, then this wont work; exceptions will all get thrown at the  
COMMIT phase.  zalchemy doesnt solve this either.
** "guaranteed" as close as we can get without accessing a true two- 
phase API on the database itself, which AFAICT is not possible with  
DBAPI.   also if constraint checking is deferred until commit, like  
above the whole strategy fails.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to