Hi all -

I'm wrapping specs in transactions, and actually using Minitest::Hooks and 
the setup it suggests:

def around_all
  DB.transaction(rollback: :always) { super }
end

def around
  DB.transaction(rollback: :always, savepoint: true, auto_savepoint: true) 
{ super }
end

This has worked fine up until now, but I'm trying to update my app to use 
Postgres' serializable transactions:

DB.transaction isolation: :serializable, retry_on: 
Sequel::SerializationFailure do
  # Code goes here...
end

Unfortunately, this fails with a: "Sequel::Error: cannot set :retry_on 
options if you are already inside a transaction". So, is there a clean way 
to get these features to play well together? I guess I could update my app 
code to only call transaction with those options when not in the test 
environment, but that seems kind of hacky.

Thanks!
Chris

-- 
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