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