IBM Support

Flushing the WebSphere Application Server data source statement cache and connection pool

Troubleshooting


Problem

This document shows how to flush a PreparedStatement or CallableStatement from the statement cache of a data source configured in IBM WebSphere Application Server.

Resolving The Problem

The JDBC statement cache is associated with each connection, the only way to flush the cache at runtime is by flushing the connection pool itself using one of the following methods:

  1. Programmatically by calling the static WSCallHelper.setConnectionError method passing a connection to it:
    WSCallHelper.setConnectionError(conn)

    See the Data access portability features in the WebSphere Application Server Information Center for details on how to use the WSCallHelper.

  2. Use Mbeans to purge the connection pool:
    set ds [$AdminControl queryNames *,type=DataSource,name=<ds_name>] $AdminControl invoke $ds purgePoolContents

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"DB Connections\/Connection Pooling","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"9.0;8.5.5;8.0;7.0","Edition":"Base;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21217934