|
Problem |
A connection returned from a datasource returns a
ClassCastException when a cast to a vendor-specific connection class is
attempted. Therefore, vendor specific functions are not available for use
because there are restrictions when using vendor specific functions. A
Java™ code example is provided. |
|
Solution |
This technique has the following considerations:
- Connection manager (CM) cannot track any objects created using the
physical connection; therefore:
- CallableStatement is not cached.
- The application must take care of closing the CallableStatement and
the ResultSet from the getCursor call.
- Stale connection exception handling is not done when the
CallableStatement or ResultSet is processed.
- Orphan timeout might terminate the connection while it is still being
used; therefore, the timeout value must be set to a large enough value to
cover the amount of time for processing, or it must be turned off.
- If AutoCommit is turned off and commit or rollback is not done, CM
does not detect this because CM thinks nothing happened on the connection
and does not do an auto rollback. It is up to the application to ensure a
commit or rollback is done. Failure of the application to take care of
these items can cause a dirty connection to be put back into the
connection free pool, which could cause other problems.
Refer to the OracleCallableStatementServlet.java. |
|
|
|
|
|
|