The following seems to work, but reading some other threads I'm confused 
why, as they had to alter how transaction worked, or pass in server: 
:my_server.

I just want to make sure that using with_server followed by a transaction 
block, will mean the transaction AND all the model 
create/save/update/delete calls run against the server specified in the 
with_server block.

model_object.db.with_server(:write_access) do
  model_object.db.transaction( rollback: :reraise) do


  end

end



This seems to work.  All the creates within the block happen against the 
:write_access server, and if one of them fails, a rollback happens.

Now, if I create 2 separate connections instead of the sharding mechanism, 
naming them reader_db and writer_db.  This would not rollback.

Was this fixed since this article?
https://groups.google.com/forum/#!topic/sequel-talk/aXrOnezRJ9s

*In that article you instructed the person to use:*
  def DB.transaction(opts={}, &block)
    super{with_server(opts[:server], &block)}
  end

*In this article, the person just passes server => :server_symbol_name:*
https://groups.google.com/forum/#!searchin/sequel-talk/transaction/sequel-talk/FXPE3RGXVIw/KNud26tCAAAJ
DB.transaction( :server => :testserver )

-- 
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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to