Background
OracleEnhanced::OCIConnection#select and OracleEnhanced::JDBCConnection#select have no callers inside the library (grep against lib/ returns zero hits). PR #2768 marks both :nodoc: because they remain spec-only helpers. The deprecation_warning that PR #2768 briefly added is dropped in the same PR — the retry behaviour that vanished with the driver-level with_retry removal only fired under auto_retry = true, which already raises NotImplementedError through OracleEnhancedAdapter#auto_retry=, so there are no real users to warn.
This issue tracks the removal step on its own, so the spec migration scope stays separate from #2768.
Goal
Delete Connection#select (and the Connection#select_no_retry companion on JDBC) once spec call sites have been migrated to an alternative. Driver-level query helpers that bypass the AR adapter add internal-API surface that does not pull its weight (only specs use it, and only for admin / V$ queries that the AR adapter can serve too).
Steps
- Catalog the remaining call sites in
spec/active_record/connection_adapters/oracle_enhanced/connection_spec.rb:
should execute SQL select (@conn.select("SELECT * FROM dual")) and should execute SQL select and return also columns — these are literal regression tests for the helper. Delete or rewrite to assert the equivalent AR-API behaviour.
kill_current_session helper — @conn.select(...) for userenv('sessionid') lookup. @sys_conn.select(...) for the v$session lookup. The latter needs SYS privileges, so it cannot trivially move to ActiveRecord::Base.lease_connection (which is the application user).
connection_id_from_server helper — same @sys_conn.select(...) SYS-only lookup.
- For the
@conn.select(...) lookups, replace with ActiveRecord::Base.lease_connection.select_one(...) (or select_all(...).to_a.first).
- For the
@sys_conn.select(...) SYS-only lookups, pick one of:
- Replace with
@sys_conn.exec(...) + manual cursor iteration (cursor.fetch; cursor[col_index]; cursor.close).
- Add a small spec helper module that wraps the cursor iteration so the call sites stay readable.
- Establish a separate AR connection pool for the SYS user and route the SYS lookup through
lease_connection.select_one on that pool.
- Once all call sites are gone, remove
Connection#select from both oci_connection.rb and jdbc_connection.rb, and remove Connection#select_no_retry from jdbc_connection.rb (it has no other callers).
Out of scope
Connection#exec is not part of this cleanup. It is reached widely from lib/ (DDL, prepared statements, schema introspection) and is part of how the adapter actually talks to OCI / JDBC.
Background
OracleEnhanced::OCIConnection#selectandOracleEnhanced::JDBCConnection#selecthave no callers inside the library (grepagainstlib/returns zero hits). PR #2768 marks both:nodoc:because they remain spec-only helpers. The deprecation_warning that PR #2768 briefly added is dropped in the same PR — the retry behaviour that vanished with the driver-levelwith_retryremoval only fired underauto_retry = true, which already raisesNotImplementedErrorthroughOracleEnhancedAdapter#auto_retry=, so there are no real users to warn.This issue tracks the removal step on its own, so the spec migration scope stays separate from #2768.
Goal
Delete
Connection#select(and theConnection#select_no_retrycompanion on JDBC) once spec call sites have been migrated to an alternative. Driver-level query helpers that bypass the AR adapter add internal-API surface that does not pull its weight (only specs use it, and only for admin / V$ queries that the AR adapter can serve too).Steps
spec/active_record/connection_adapters/oracle_enhanced/connection_spec.rb:should execute SQL select(@conn.select("SELECT * FROM dual")) andshould execute SQL select and return also columns— these are literal regression tests for the helper. Delete or rewrite to assert the equivalent AR-API behaviour.kill_current_sessionhelper —@conn.select(...)foruserenv('sessionid')lookup.@sys_conn.select(...)for thev$sessionlookup. The latter needs SYS privileges, so it cannot trivially move toActiveRecord::Base.lease_connection(which is the application user).connection_id_from_serverhelper — same@sys_conn.select(...)SYS-only lookup.@conn.select(...)lookups, replace withActiveRecord::Base.lease_connection.select_one(...)(orselect_all(...).to_a.first).@sys_conn.select(...)SYS-only lookups, pick one of:@sys_conn.exec(...)+ manual cursor iteration (cursor.fetch; cursor[col_index]; cursor.close).lease_connection.select_oneon that pool.Connection#selectfrom bothoci_connection.rbandjdbc_connection.rb, and removeConnection#select_no_retryfromjdbc_connection.rb(it has no other callers).Out of scope
Connection#execis not part of this cleanup. It is reached widely fromlib/(DDL, prepared statements, schema introspection) and is part of how the adapter actually talks to OCI / JDBC.