Skip to content

Commit f98f69f

Browse files
yahondaclaude
andcommitted
Disable JDBC auto-commit on new connections
ojdbc17 23.x defaults auto-commit to true (per JDBC spec), while older Oracle drivers defaulted to false. The gem relies on explicit commit and rollback, so every commit call raised ORA-17273 on JRuby CI. Set setAutoCommit(false) explicitly after creating raw JDBC connections in both the production code path and the spec test harness to restore the long-standing behavior regardless of driver default. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f231661 commit f98f69f

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

lib/plsql/jdbc_connection.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def self.create_raw(params)
6363
props.setProperty("password", params[:password])
6464
end)
6565
end
66+
conn.setAutoCommit(false)
6667
new(conn)
6768
end
6869

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def get_connection(user_number = 0)
9898
props.setProperty("user", database_user)
9999
props.setProperty("password", database_password)
100100
end)
101-
end
101+
end.tap { |c| c.setAutoCommit(false) }
102102
end
103103
end
104104
end

0 commit comments

Comments
 (0)