org.jboss.resource.adapter.jdbc
public class: PreparedStatementCache [javadoc |
source]
java.lang.Object
org.jboss.util.LRUCachePolicy
org.jboss.resource.adapter.jdbc.PreparedStatementCache
All Implemented Interfaces:
CachePolicy
LRU cache for PreparedStatements. When ps ages out, close it.
- author:
< - a href="mailto:bill@jboss.org">Bill Burke
- author:
< - a href="mailto:adrian@jboss.com">Adrian Brock
- author:
Scott.Stark - @jboss.org
- version:
$ - Revision: 73034 $
| Method from org.jboss.resource.adapter.jdbc.PreparedStatementCache Summary: |
|---|
|
ageOut, toString |
| Methods from org.jboss.util.LRUCachePolicy: |
|---|
|
ageOut, cacheMiss, create, createCacheEntry, createList, destroy, flush, get, insert, peek, remove, size, start, stop |
| Method from org.jboss.resource.adapter.jdbc.PreparedStatementCache Detail: |
protected void ageOut(LRUCachePolicy.LRUCacheEntry entry) {
try
{
CachedPreparedStatement ws = (CachedPreparedStatement) entry.m_object;
ws.agedOut();
}
catch (SQLException e)
{
log.debug("Failed closing cached statement", e);
}
finally
{
super.ageOut(entry);
}
}
|
public String toString() {
String s = " PreparedStatementCache size: " + m_list.m_count;
for (LRUCacheEntry entry = m_list.m_head; entry != null; entry = entry.m_next)
{
CachedPreparedStatement ws = (CachedPreparedStatement) entry.m_object;
PreparedStatementCache.Key key = (PreparedStatementCache.Key) entry.m_key;
s += "[" + key.getSql() + "] ";
}
return s + "\n";
}
|