Skip to content

Commit ebc8876

Browse files
committed
Redefine isolation level method as MSSSQL resets isolation after transaction
1 parent 048734d commit ebc8876

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/cases/coerced_tests.rb

+10
Original file line numberDiff line numberDiff line change
@@ -1842,6 +1842,16 @@ class TransactionIsolationTest < ActiveRecord::TestCase
18421842

18431843
# I really need some help understanding this one.
18441844
coerce_tests! %r{repeatable read}
1845+
1846+
private
1847+
1848+
# The isolation level is set twice. Once by the transaction and once when the connection is reset
1849+
# by `SQLServerRealTransaction#commit`. MySQL & PostgreSQL do not reset the connection and SQLite does support
1850+
# transaction isolation.
1851+
undef_method :assert_begin_isolation_level_event
1852+
def assert_begin_isolation_level_event(events)
1853+
assert_equal 2, events.select { _1.match(/SET TRANSACTION ISOLATION LEVEL READ COMMITTED/) }.size
1854+
end
18451855
end
18461856

18471857
class ViewWithPrimaryKeyTest < ActiveRecord::TestCase

0 commit comments

Comments
 (0)