将max_allow_packet参数提取到配置文件中,不用每次从数据库中读取
This commit is contained in:
@@ -352,7 +352,7 @@ public class AppCfgService extends BaseService {
|
||||
specificServiceCfgDao.update(specificServiceCfg);
|
||||
}
|
||||
Integer compileId = configGroupInfo.getCompileId();
|
||||
Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet");
|
||||
// Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet");
|
||||
List<AppIpCfg> tempList=Lists.newArrayList();
|
||||
int len=0;
|
||||
for(BaseIpCfg cfg:cfgs) {
|
||||
@@ -360,7 +360,7 @@ public class AppCfgService extends BaseService {
|
||||
BeanUtils.copyProperties(cfg, entity);
|
||||
entity.setCompileId(compileId);
|
||||
int tempLen=entity.toString().getBytes(Charset.forName("UTF-8")).length;
|
||||
if((len+tempLen)<maxPacket.getValue().longValue()) {
|
||||
if((len+tempLen)<Constants.MAX_ALLOWED_PACKET) {
|
||||
tempList.add(entity);
|
||||
len+=tempLen;
|
||||
}else {
|
||||
|
||||
Reference in New Issue
Block a user