On Thursday, May 7, 2020 at 3:34:49 PM UTC-7, Jakob Pupke wrote:
>
> Hello guys,
>
> this might be a stupid question but I can't seem to make transactions
> work. I am doing this.
>
> db = Sequel.connect("mysql2://user:[email protected]/database")
> db.transaction(rollback: :always) do
> db[:table].insert(id: 1)
> raise
> end
>
> Why do I end up with a new row in the table here? It's not rolled back.
>
I'm guessing the table uses the MyISAM storage engine, which doesn't
support transactions. If you have the ability to choose the database to
use, I strongly recommend switching from MySQL to PostgreSQL. However, if
you are forced to use MySQL due to circumstances beyond your control, you
could also try using the InnoDB storage engine for the table.
Thanks,
Jeremy
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/ff3f8449-0261-4c3d-8e2e-62060feb8a4a%40googlegroups.com.