try {
// for each connection type opened in this componet
Map<ConnectionTrackingInterceptor, Set<ConnectionInfo>> resources = currentContext.getConnectionManagerMap();
for (Iterator<Map.Entry<ConnectionTrackingInterceptor, Set<ConnectionInfo>>> iterator = resources.entrySet().iterator(); iterator.hasNext();) {
Map.Entry<ConnectionTrackingInterceptor, Set<ConnectionInfo>> entry = iterator.next();
ConnectionTrackingInterceptor mcci = entry.getKey();
Set<ConnectionInfo> connections = entry.getValue();
// release proxy connections
if (lazyConnect) {
for (ConnectionInfo connectionInfo : connections) {
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()) {
iterator.remove();
}