A question/comment...
The fix committed for this issue in ResultSetReturnImpl.java performs an instanceof check on the statement object to determine if it is an instance of CallableStatement. This presents a problem if a framework wraps a statement object in either a proxy or a concrete class that implements both PreparedStatement and CallableStatement which can result in wrapped PreparedStatement objects being identified as CallableStatement instances with the end result being a ClassCastException, AbstractMethodError, or NoSuchMethodException error in the wrapper or proxy.
Since JDK 6 is now a minimum requirement it seems like a more compatible fix would have been to call java.sql.Wrapper.isWrapperFor(CallableStatement.class) method on the statement object to determine the instance type instead of the instanceof keyword. While I'm not stating that the implemented fix is technically wrong, it seems like the use of Wrapper.isWrapperFor would promote improved compatibility across the greatest range of pooling frameworks, JDBC drivers, etc.
|