Interface StatementCacheMBean
- All Known Implementing Classes:
StatementCache
public interface StatementCacheMBean
MBean interface for monitoring the statement cache.
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of statements currently held in the statement cache, counted across all connections that belong to the same connection pool - the value themaxlimit is compared against.intReturns the cache size for the current connection: the statements parked in this connection's cache.intReturns the maximum size of the statement cache.booleanChecks if callable statements are being cached.booleanChecks if prepared statements are being cached.
-
Method Details
-
isCachePrepared
boolean isCachePrepared()Checks if prepared statements are being cached.- Returns:
- true if prepared statement caching is enabled
-
isCacheCallable
boolean isCacheCallable()Checks if callable statements are being cached.- Returns:
- true if callable statement caching is enabled
-
getMaxCacheSize
int getMaxCacheSize()Returns the maximum size of the statement cache.- Returns:
- maximum cache size
-
getCacheSize
int getCacheSize()Returns the number of statements currently held in the statement cache, counted across all connections that belong to the same connection pool - the value themaxlimit is compared against. The number is a snapshot of the pool's accounting at the moment of the read; it is not a handle that can be used to change that accounting.- Returns:
- the number of cached statements, or
-1if this interceptor instance is not bound to a pooled connection
-
getCacheSizePerConnection
int getCacheSizePerConnection()Returns the cache size for the current connection: the statements parked in this connection's cache. Parked statements are physically open until the cache is disposed, so this is not the number of statements ready to run. A read against an interceptor that is not bound to a pooled connection, for instance one made while a disposal is in progress, is answered quietly rather than logged.- Returns:
- number of cached statements for this connection, or
0if this interceptor instance is not bound to a pooled connection
-