Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-462

Refactoring of PStmtKey and PoolingConnection

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.2.0
    • Labels:
      None
    • Flags:
      Patch

      Description

      In PoolingConnection, the following methods are not defined.
      -prepareStatement(String sql, int[] columnIndexes)
      -prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
      -prepareStatement(String sql, String[] columnNames)
      -prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
      Therefore, when calling these methods, we can not cache statements.

      I had tried to implement these methods in PoolingConnection.
      However, because the code in the PoolingConnection#makeObject is a little complex,
      I thought that it is difficult to add new conditions.
      So, in order to more easily implement the Connection#prepareStatement that are not defined in the PoolingConnection,
      I did a refactoring for the PStmtKey and PoolingConnection.

      If these refactoring are accepted,I have a plan to implement the following methods to PoolingConnection
      in order to cache all of Prepared or Callable Statement.
      -prepareStatement(String sql, int[] columnIndexes)
      -prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
      -prepareStatement(String sql, String[] columnNames)
      -prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)

        Attachments

        1. TestPoolingConnection.java
          5 kB
          KeiichiFujino
        2. TesterPreparedStatement.txt
          2 kB
          KeiichiFujino
        3. TesterConnection.txt
          1 kB
          KeiichiFujino
        4. PStmtKey.txt
          6 kB
          KeiichiFujino
        5. PoolingConnection.txt
          3 kB
          KeiichiFujino

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              KeiichiFujino KeiichiFujino
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: