I figured what is happening. My Models are beign initialized with a dataset set to server :one like so: Sequel::Model(DB.from(Sequel[:public][:accounts]).server(:one)) While the DB.transaction is scoped to server :default
Em segunda-feira, 25 de março de 2019 17:03:25 UTC-3, Adriano Tirloni escreveu: > > I'm new to Sequel and don't know if this is the expected behaviour. > > > This code will not rollback account creation > DB.transaction do > account = Account.create() > post = Post.create(account_id: nil) > #raised Sequel::NotNullConstraintViolation > end > > While this will > > DB.with_server(:one) > DB.transaction do > account = Account.create() > post = Post.create(account_id: nil) > #raised Sequel::NotNullConstraintViolation > end > end > -- 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.
