Vibur DBCP v17.0 Release Notes

Release Date: 2017-04-05 // about 7 years ago
    • Reimplemented the StatementExecution hook as an around advice (in terms of AOP) instead of being an after advice as before. Now any implemented by user StatementExecution hooks are responsible for using the supplied StatementProceedingPoint to pass the call to the intercepted Statement "execute..." method or to the next registered StatementExecution hook via something like:

      (proxy, method, args, sqlQuery, sqlQueryParams, proceed) -> { // Java 8 try { // do something before the real method execution, for example, increment a queriesInProcess counter // or start a stopwatch

          Object result = proceed.on(proxy, method, args, sqlQuery, sqlQueryParams, proceed); // execute it
      
          // examine a thrown SQLException if necessary, retry the Statement execution if appropriate, etc
      
          return result;
      
      } finally {
          // do something after the real method execution, for example, decrement a queriesInProcess counter
          // or stop a stopwatch
      }
      

      }

    This construct allows for easy execution of supplied by user before and after Statement execution logic.

    • 🛠 Fixed a minor bug in building sqlQueryParams.
    • 🔨 Various other small refactoring, javadoc updates and clarifications, source code clean-up.