On Jul 17, 2013, at 10:32 AM, Antoni Silvestre Padrós 
<antoni.silves...@gmail.com> wrote:

> Hi, I have a service that sends transactions to many different mysql nodes 
> using sqlalchemy, one basic requirement for this service is to always have 
> the same state in all the nodes, thus if one update in one node fails I have 
> to rollback the transaction in the nodes that the update had been processed 
> successfully.
> 
> In order to do that I use two phase transactions, I use sessions and the 
> merge method to send updates to every node, I send the prepare command to 
> every node and if this succeeds I send the commit method to all of them.
> 
> This works well for transactions that only affect one table, if everything 
> goes well it updates that table and if there's an error in one node the 
> changes are rolled back in the rest of the nodes.
> 
> The problem I have is when a transaction affects more than one table, it 
> looks like that when I perform the merge operation to a table the previous 
> merge's of that same transaction are automatically committed to the DB even 
> before the prepare or the commit commands (not sure about prepare but for 
> sure about the commit command) and in the end if one node fails the other 
> nodes only get rolled back the changes for the last affected table of the 
> transaction but the changes for the other tables are committed.
> 
> Any ideas about what I might be doing wrong?

not really.  Do you have InnoDB enabled for all tables?


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to