oracle / oracle-r2dbc

R2DBC Driver for Oracle Database
https://oracle.com
Other
194 stars 40 forks source link

Eliminating JDBC Lock Contention #57

Closed Michael-A-McMahon closed 2 years ago

Michael-A-McMahon commented 2 years ago

This branch has Oracle R2DBC using the AsyncLock to execute synchronous JDBC method calls. Oracle JDBC blocks threads that invoke synchronous methods when an asynchronous database call is in flight. This can lead to thread pool starvation and deadlocks, as described in the branch that introduce the AsyncLock (#49 ). The original branch only handled asynchronous calls, this new branch also adds async locking for synchronous calls.

I've also refactored OracleStatementImpl, with a new inner class: JdbcStatement. A JdbcStatement encapsulates the state and behavior of executing a JDBC PreparedStatement. Subclasses implement this execution in different ways, such as creating a batch of DML update counts, or returning values generated by DML, or returning out-parameters of a PL/SQL call. This seems to cleaned up the code in OracleStatementImpl, which had become very messy over the last year.