Skip to content

Commit 3516181

Browse files
committed
[WIP] See if dbms_session.sleep works for 18c or higher
12c support will be restored.
1 parent fb4f0be commit 3516181

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

spec/plsql/schema_spec.rb

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,19 @@ class TestModel < TestBaseModel
229229
end
230230

231231
it "should safely close cursors in threaded environment" do
232-
expect {
233-
t1 = Thread.new { plsql.dbms_lock.sleep(1) }.tap { |t| t.abort_on_exception = true }
234-
t2 = Thread.new { plsql.dbms_lock.sleep(2) }.tap { |t| t.abort_on_exception = true }
235-
[t2, t1].each { |t| t.join }
236-
}.not_to raise_error
232+
if (plsql.connection.database_version <=> [18, 0, 0, 0]) >= 0
233+
expect {
234+
t1 = Thread.new { plsql.dbms_session.sleep(1) }.tap { |t| t.abort_on_exception = true }
235+
t2 = Thread.new { plsql.dbms_session.sleep(2) }.tap { |t| t.abort_on_exception = true }
236+
[t2, t1].each { |t| t.join }
237+
}.not_to raise_error
238+
else
239+
expect {
240+
t1 = Thread.new { plsql.dbms_lock.sleep(1) }.tap { |t| t.abort_on_exception = true }
241+
t2 = Thread.new { plsql.dbms_lock.sleep(2) }.tap { |t| t.abort_on_exception = true }
242+
[t2, t1].each { |t| t.join }
243+
}.not_to raise_error
244+
end
237245
end
238246

239247
end if defined?(ActiveRecord)

0 commit comments

Comments
 (0)