将max_allow_packet参数提取到配置文件中,不用每次从数据库中读取
This commit is contained in:
@@ -175,10 +175,10 @@ public class SaveAsnIpThread implements Callable<Throwable>{
|
||||
long start=System.currentTimeMillis();
|
||||
int len=0;
|
||||
List<AsnIpCfg> tempList=Lists.newArrayList();
|
||||
Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet");
|
||||
// Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet");
|
||||
for(AsnIpCfg asnIpCfg:entitys) {
|
||||
int tempLen=asnIpCfg.toString().getBytes(Charset.forName("UTF-8")).length;
|
||||
if((len+tempLen)<maxPacket.getValue().longValue()) {
|
||||
if((len+tempLen)<Constants.MAX_ALLOWED_PACKET) {
|
||||
tempList.add(asnIpCfg);
|
||||
len+=tempLen;
|
||||
}else {
|
||||
|
||||
Reference in New Issue
Block a user