Hello Jeremy,
thanks a bunch. That was it indeed. I didn't know there is an engine that
does not support transactions. Thought this is a basic feature of RDBMS.
I cannot switch to Postgres in this case but I can certainly switch to
InnoDB.
Again, thanks
Bye
Am Freitag, 8. Mai 2020 01:06:43 UTC+2 schrieb Jeremy Evans:
>
> 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/08fa8772-7a04-4239-bc35-60eed193f455%40googlegroups.com.