recursionFlag--;
if (recursionFlag > 0) {
return;
}
else if (recursionFlag < 0) {
throw new JThinkRuntimeException(JThinkErrorCode.ERRCODE_SYS_RUNTIME,
"事务嵌套标志小于了0. begin(),close()方法不匹配!");
}
try{
if(ut!=null){
ut.rollback();
ut=null;
}
Iterator keysIT = openedConnsHM.keySet().iterator();
while(keysIT.hasNext()){
String connId = (String)keysIT.next();
Connection conn = (Connection)openedConnsHM.get(connId);
if(useConnectionPool(connId)){
ConnectionPool connPool = ConnectionPool.getConnectionPool(connId);
/* 将活动连接返回到连接池 */
connPool.returnConnection(conn);
}else{
/* 释放连接 */
conn.close();
}
}
}catch(JThinkRuntimeException e){
throw e;
}catch(Exception e){
throw new JThinkRuntimeException(JThinkErrorCode.ERRCODE_DB_SQL_EXCEPTION, "事务关闭时发生异常!", e);
}finally{
openedConnsHM.clear();
}
}