Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Pipelining #145

Merged
merged 2 commits into from
May 24, 2024
Merged

Support for Pipelining #145

merged 2 commits into from
May 24, 2024

Conversation

Michael-A-McMahon
Copy link
Member

This branch updates the Oracle JDBC dependency to 23.4, and adds support for pipelined database calls.

Changes in the README explain what pipelining is, what is required to use it.

The biggest change for the Oracle R2DBC code base is the use of AsyncLock. The 21.x releases of Oracle JDBC would block threads that attempted to make concurrent database calls. The AsyncLock was devised as a way to avoid this locking (and the possibility of dead-locking that came with it). The 23.4 release of Oracle JDBC does away with this locking. That was a key change required to support pipelining.

In this branch, AsyncLock becomes an interface with two concrete implementations:

  1. AsyncLockImpl this is existing implementation of AsyncLock.
  2. NoOpAsyncLock this is an implementation that does nothing.

Oracle R2DBC will now check the major version of Oracle JDBC at runtime, and then decide which AsyncLock it needs to use: 23 or newer? Then NoOpAsyncLock. Otherwise, AsyncLockImpl.

Arguably, we could delete AsyncLock entirely. A strict dependency on 23.4 should mean that Oracle R2DBC no longer needs to support the older versions of Oracle JDBC. I've opted to leave support for the 21.x Oracle JDBC Driver in place for now. I think there may be some value for users in this, as it provides time for a transition from 21 to 23. The new 23 version has some changes which are known to break existing applications; In fact they broke some existing test cases for Oracle R2DBC (you can see the changes in this PR). Given that Oracle R2DBC was already designed to work the 21 driver, we can continue to support at almost no development cost. We will want to drop support for 21 at some point, but I see no need to rush.

A potentially performance impacting change has "zero copy IO" disabled by default. This is necessary to workaround a known issue where the database does not respond to pipelined calls that result in an error, and that use zero copy IO for bind values. Notably, zero copy IO is used for JSON and VECTOR bind values. Disabling this performance optimization seemed like a better option than not supporting pipelining, or not supporting JSON and VECTOR.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 9, 2024
@Michael-A-McMahon Michael-A-McMahon self-assigned this May 9, 2024
@Michael-A-McMahon Michael-A-McMahon linked an issue May 9, 2024 that may be closed by this pull request
@Michael-A-McMahon Michael-A-McMahon mentioned this pull request May 15, 2024
@jeandelavarene jeandelavarene merged commit fc037e4 into main May 24, 2024
3 checks passed
@jeandelavarene jeandelavarene deleted the pipelining branch May 24, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Pipelining
2 participants