Sorry for bothering you again.
We had to turn on use_old_oracle_visitor in order for locking to work (e.g. User.first.lock!). However, this reinstates the issue described in #1030 and #1033:
User.limit(5).offset(1).to_a
results in
ActiveRecord::StatementInvalid: Java::JavaSql::SQLException: Missing IN or OUT parameter at index:: 3:
SELECT * FROM (
SELECT raw_sql_.*, rownum raw_rnum_
FROM (SELECT "USERS".* FROM "USERS" ) raw_sql_ WHERE rownum <= (:a1 + :a2) ) WHERE raw_rnum_ > :a1
from oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(oracle/jdbc/driver/OraclePreparedStatement.java:2076)
I really hope there is a way of combining these two fixes as both locking and limiting / ofsetting is crucial for us. Many thanks for your help!