100 {
101
102 int mysql_error = connection.getErrorCode();
103
104 if (
_error_map.containsKey(mysql_error) ==
false){
106 connectorMgr mgr = new connectorMgr();
107 mgr.pconnection = connection;
109
110 if (_maxIdleTime != 0){
111 List.Iterator<connectorMgr> it =
_pool.iterator();
112
113 while (it != nilptr && it.hasNext()){
114 List.Iterator<connectorMgr> tmp = it.getNext();
115 connectorMgr pmt = it.get();
116
117 if ((mgr.timestamp - pmt.timestamp) > _maxIdleTime){
118 pmt.pconnection.close();
121 }
122 it = tmp;
123 }
124 }
125
126
127
128 if (_maxIdle != 0){
129 while (
_pool.size() > _maxIdle){
130 List.Iterator<connectorMgr> tmp =
_pool.iterator();
131 connectorMgr pmt = tmp.get();
132 pmt.pconnection.close();
135 }
136 }
139 }
140 } else{
141 connection.close();
144 }
145 }
146 }
static final long currentTimeMillis()