Package net.jextra.fauxjo
Interface StatementCacheListener
-
public interface StatementCacheListenerReceive events related to caching PreparedStatements or CallableStatements. Used to log and diagnose affinity of the caches to its threads, connections and statements.- A new ThreadLocal StmtCacheMap is created when a prepare/callStatement request is from a new Thread.
- A new StmtCache (StatementCache.PerConnectionCache) is created and cached in the StmtCacheMap by its Connection when the prepare/callStatement request encounters a new Connection.
- The least recently used Prepared/CallableStatement will be evicted from the StmtCache if expired or StmtCache fills up to guard against Prepared/CallableStatements with concatenated criteria instead of using parameters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classStatementCacheListener.EvictTypestatic classStatementCacheListener.StmtType
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearedStmtCacheForConn(StatementCache.Config ctype, Thread t, Long dbConKey)StatementCache.clear(Connection) was called so its StmtCache was released.voidclearedStmtCacheMapForThread(StatementCache.Config ctype, Thread t)StatementCache.clear was called so its listeners, StmtCacheMap and StmtCaches have been released.voidevictedLruStmt_MaxEntries(StatementCache.Config ctype, StatementCacheListener.StmtType type, String sql, long createdOnTs, long accessedCn, long maxCacheEntries)The least recently used statement was evicted, StmtCache would have exceeded maxEntries.voidevictedLruStmt_MaxTtl(StatementCache.Config ctype, StatementCacheListener.StmtType type, String sql, long createdOnTs, long accessedCn, long ageMillisMax)The least recently used statement was evicted, it exceeded its maxTtl.voidevictLruStmtException(StatementCache.Config ctype, StatementCacheListener.StmtType type, Throwable throwable)An exception was thrown while trying to close an evicted Statement.voidnewStmtCacheForNewConn(StatementCache.Config ctype, Thread t, Long dbConKey, String stmtSql)An uncached Connection from prepare/callStatement request created a new StmtCache in StmtCacheMap.voidnewStmtCacheMapForNewThread(StatementCache.Config ctype, Thread t)A new Thread was encountered resulting in a new ThreadLocal StmtCacheMap.voidpreparedCall(StatementCache.Config ctype, Thread t, Long dbConKey)voidpreparedStmt(StatementCache.Config ctype, Thread t, Long dbConKey)voidreusedStmt(StatementCache.Config ctype, Thread t, Long dbConKey)voidsetStmtCacheMaxEntries(StatementCache.Config ctype, Thread t, Integer maxStmts)Per prepare/callStatement, the eldest Statement is evicted if cache has this many entries.voidsetStmtCacheMaxTtl(StatementCache.Config ctype, Thread t, Long maxTTL)Per prepare/callStatement call, the eldest Statement is evicted if older than this value.
-
-
-
Method Detail
-
setStmtCacheMaxEntries
void setStmtCacheMaxEntries(StatementCache.Config ctype, Thread t, Integer maxStmts)
Per prepare/callStatement, the eldest Statement is evicted if cache has this many entries.
-
setStmtCacheMaxTtl
void setStmtCacheMaxTtl(StatementCache.Config ctype, Thread t, Long maxTTL)
Per prepare/callStatement call, the eldest Statement is evicted if older than this value.
-
evictedLruStmt_MaxEntries
void evictedLruStmt_MaxEntries(StatementCache.Config ctype, StatementCacheListener.StmtType type, String sql, long createdOnTs, long accessedCn, long maxCacheEntries)
The least recently used statement was evicted, StmtCache would have exceeded maxEntries.
-
evictedLruStmt_MaxTtl
void evictedLruStmt_MaxTtl(StatementCache.Config ctype, StatementCacheListener.StmtType type, String sql, long createdOnTs, long accessedCn, long ageMillisMax)
The least recently used statement was evicted, it exceeded its maxTtl.
-
evictLruStmtException
void evictLruStmtException(StatementCache.Config ctype, StatementCacheListener.StmtType type, Throwable throwable)
An exception was thrown while trying to close an evicted Statement.
-
newStmtCacheMapForNewThread
void newStmtCacheMapForNewThread(StatementCache.Config ctype, Thread t)
A new Thread was encountered resulting in a new ThreadLocal StmtCacheMap.
-
newStmtCacheForNewConn
void newStmtCacheForNewConn(StatementCache.Config ctype, Thread t, Long dbConKey, String stmtSql)
An uncached Connection from prepare/callStatement request created a new StmtCache in StmtCacheMap.
-
clearedStmtCacheMapForThread
void clearedStmtCacheMapForThread(StatementCache.Config ctype, Thread t)
StatementCache.clear was called so its listeners, StmtCacheMap and StmtCaches have been released.
-
clearedStmtCacheForConn
void clearedStmtCacheForConn(StatementCache.Config ctype, Thread t, Long dbConKey)
StatementCache.clear(Connection) was called so its StmtCache was released.
-
preparedStmt
void preparedStmt(StatementCache.Config ctype, Thread t, Long dbConKey)
-
preparedCall
void preparedCall(StatementCache.Config ctype, Thread t, Long dbConKey)
-
reusedStmt
void reusedStmt(StatementCache.Config ctype, Thread t, Long dbConKey)
-
-