try {
// for each connection type opened in this componet
Map resources = currentContext.getConnectionManagerMap();
for (Iterator i = resources.entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
ConnectionTrackingInterceptor mcci =
(ConnectionTrackingInterceptor) entry.getKey();
Set connections = (Set) entry.getValue();
// release proxy connections
if (lazyConnect) {
for (Iterator infoIterator = connections.iterator(); infoIterator.hasNext();) {
ConnectionInfo connectionInfo = (ConnectionInfo) infoIterator.next();
releaseProxyConnection(connectionInfo);
}
}
// use connection interceptor to dissociate connections that support disassociation
mcci.exit(connections);
// if no connection remain clear context... we could support automatic commit, rollback or exception here
if (connections.isEmpty()) {
i.remove();
}