Thanks for you quick response.
I was missing the output "SET TRANSACTION ISOLATION LEVEL READ COMMITTED" but this was due to my test environment. It wraps every test-run in a transaction already: DB.transaction(rollback: :always, auto_savepoint: true) So instead of calling the method "begin_new_transaction" (which calls set_transaction_isolation), sequel is using the "begin_savepoint" method. In a normal dev-environment I can see "SET TRANSACTION" in the debug output. Thanks again. Am Freitag, 9. Februar 2018 16:18:51 UTC+1 schrieb Jeremy Evans: > > On Friday, February 9, 2018 at 3:28:46 AM UTC-8, Robert Aschenbrenner > wrote: >> >> Hi there, >> >> I am trying to use the 'READ COMMITTED' transaction isolation level as >> documented here: >> >> http://sequel.jeremyevans.net/rdoc/files/doc/transactions_rdoc.html#label-Transaction+Isolation+Levels >> >> The following example runs without an error, but the isolation option is >> dropped: >> >> DB.transaction(isolation: :committed) do >> DB[:users].insert(user_id: 'test') >> end >> >> Stepping through the code the "isolation: :commited" option appears to be >> dropped in the transaction_options method: >> >> https://github.com/jeremyevans/sequel/blob/master/lib/sequel/database/transactions.rb#L274 >> >> The method has a comment saying: "Meant to be overridden", which is not >> the case. >> >> I am using the sequel 5.5.0 gem with a mysql 5.6.35 database. >> >> Am I missing something or is this a bug? >> >> > I can't reproduce the issue you are seeing. It appears to work for me: > > $ sequel -E "mysql2://..." -c "DB.transaction(isolation: :committed){puts > DB.get(1)}" > I, [2018-02-09T07:15:54.574572 #18636] INFO -- : (0.000297s) SET > @@wait_timeout = 2147483 > I, [2018-02-09T07:15:54.574826 #18636] INFO -- : (0.000086s) SET > SQL_AUTO_IS_NULL=0 > I, [2018-02-09T07:15:54.575248 #18636] INFO -- : (0.000088s) SET > TRANSACTION ISOLATION LEVEL READ COMMITTED > I, [2018-02-09T07:15:54.575391 #18636] INFO -- : (0.000082s) BEGIN > I, [2018-02-09T07:15:54.575947 #18636] INFO -- : (0.000236s) SELECT > version() > I, [2018-02-09T07:15:54.576459 #18636] INFO -- : (0.000111s) SELECT 1 AS > `v` LIMIT 1 > 1 > I, [2018-02-09T07:15:54.576675 #18636] INFO -- : (0.000065s) COMMIT > > If it still isn't working for you, can you put together a minimal self > contained example showing the issue? Note that the transaction_options > method is not related to this, the SQL is issued > in set_transaction_isolation, which doesn't use the hash returned by > transaction_options. > > 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 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.
