Stack<Map<String, FixConnectionResult>> stack = getStack(dbConnectionThreadLocal);
if (stack.isEmpty()) {
Map<String, FixConnectionResult> connectioMap = new HashMap<String, FixConnectionResult>();
FixConnectionResult fixConnectionResult = ConnectionManagement.INSTANCE().getFixConnectionResult(dbId);
connectioMap.put(dbId, fixConnectionResult);
getStack(dbConnectionThreadLocal).push(connectioMap);
fixConnectionResult.openConnection();
return fixConnectionResult.getConnection();
}
Map<String, FixConnectionResult> connMap = stack.peek();
if (connMap == null) {
Map<String, FixConnectionResult> connectioMap = new HashMap<String, FixConnectionResult>();
FixConnectionResult fixConnectionResult = ConnectionManagement.INSTANCE().getFixConnectionResult(dbId);
connectioMap.put(dbId, fixConnectionResult);
getStack(dbConnectionThreadLocal).push(connectioMap);
fixConnectionResult.openConnection();
return fixConnectionResult.getConnection();
} else {
FixConnectionResult fixConnectionResult = connMap.get(dbId);
if (fixConnectionResult == null) {
FixConnectionResult fixConnectionResultObj = ConnectionManagement.INSTANCE().getFixConnectionResult(dbId);
connMap.put(dbId, fixConnectionResultObj);
fixConnectionResultObj.openConnection();
return fixConnectionResultObj.getConnection();
} else {
// fixConnectionResult.openConnection();