I have an odd use case. I take data, process it and then put it into two 
different databases the flow goes something like this

db1=....
db2= ....

r1 = db1[sql].returning.insert
r2 = db2[sql].returning.insert

The first thing odd about this is that r1 and r2 are both integers, I was 
expecting an array. No big deal I guess but now I want to check to see if 
both operations succeed. If one doesn't I want to roll back both of them. 
So something like this


db1['start transaction']
db2['start transaction']

r1 = db1[sql].returning.insert
r2 = db2[sql].returning.insert

if (do some checking here)
  db1['commit']
  db2['commit']
else
  db1[rollback']
  db2['rollback']
end

would this work as I think it should?  Is there a better way?

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to