The CachedConnectionManager mbean manages associations between meta-aware objects
(those accessed through interceptor chains) and connection handles, and between
user transactions and connection handles. Normally there should only be one
such mbean. It is called by CachedConnectionInterceptor, UserTransaction,
and all BaseConnectionManager2 instances.
- David Jencks
- Erwin Guib
- Adrian Brock
- $Revision: 81820 $
ThreadLocal that holds current calling meta-programming aware
object, used in case someone is idiotic enough to cache a
connection between invocations.and want the spec required
behavior of it getting hooked up to an appropriate
ManagedConnection on each method invocation.
map of meta-aware object to set of connections it holds, used by
the idiot spec compliant behavior.
Default CachedConnectionManager managed constructor for mbeans.
Remember that this mbean should be a singleton.
log.warn("THE SpecCompliant ATTRIBUTE IS MISNAMED SEE http://jira.jboss.com/jira/browse/JBAS-1662");
throw new ResourceException("Some connections were not closed, see the log for the allocation stacktraces");
log.trace("registering connection from " + cm + ", connection : " + connection + ", key: " + key);
log.trace("unregistering connection from " + cm + ", object: " + c + ", key: " + key);
log.trace("user tx started, key: " + key);
method gets the cmToConnectionsMap
from objectToConnectionManagerMap, copies it to the key, and
reconnects all the connections in it.
Map cmToConnectionsMap = null;
if (cmToConnectionsMap == null)
boolean unclosed = false;
if (connections.size() != 0)
This is a shutdown method called by a connection manager. It will remove all reference
to that connection manager from the cache, so cached connections from that manager
will never be recoverable.
Possibly this method should not exist.
log.trace("unregisterConnectionCacheListener: " + cm);
if (cmToConnectionsMap != null)
wraps objects so they may be used in hashmaps
based on their object identity rather than equals implementation. Used for keys.
log.info("Closing a connection for you. Please close them yourself: " + c, e);
log.info("Closing a connection for you. Please close them yourself: " + c);
log.info("Throwable trying to close a connection for you, please close it yourself", t);
log.info("Could not find a close method on alleged connection objects. Please close your own connections.");
if (cas == null && createIfNotFound && TxUtils.isActive(tx))
log.debug("Unable to synchronize with transaction", t);