check修改
This commit is contained in:
parent
1806fa8153
commit
cb4d171c24
@ -161,7 +161,6 @@ public class SydApi4Database implements SydApi {
|
||||
if (null == this.hsms || this.hsms.length < 1) {
|
||||
throw new SydApiException(-1);
|
||||
}
|
||||
|
||||
byte[] procData = null;
|
||||
if (2 == iPkgNum || 3 == iPkgNum) {
|
||||
procData = Util.hexString2Bytes(pcProcData);
|
||||
@ -169,6 +168,9 @@ public class SydApi4Database implements SydApi {
|
||||
|
||||
}
|
||||
SydApiException le = null;
|
||||
LockableObject lockableObject = new LockableObject();
|
||||
lockableObject.lock();
|
||||
try {
|
||||
for (SydApi4j api : this.hsms) {
|
||||
if (null == api) {
|
||||
continue;
|
||||
@ -190,6 +192,13 @@ public class SydApi4Database implements SydApi {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e){
|
||||
|
||||
}
|
||||
finally {
|
||||
lockableObject.unlock();
|
||||
}
|
||||
throw le;
|
||||
}
|
||||
|
||||
|
||||
@ -69,16 +69,12 @@ public class SydApiPool extends ThreadBasedConnectPool<SydApi> {
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (null != hsms[i]) {
|
||||
try {
|
||||
l.lock();
|
||||
o.SYD_SM3_Hash_ShortData(new byte[8]);
|
||||
ifBoolean = true;
|
||||
} catch (Exception e) {
|
||||
// 忽略
|
||||
hsms[i] = null;
|
||||
}
|
||||
finally {
|
||||
l.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
return ifBoolean;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user