This commit is contained in:
default
2018-11-01 15:16:32 +08:00
parent 946e977a6f
commit 553487baf1
4 changed files with 19 additions and 2 deletions

View File

@@ -110,6 +110,7 @@ public class SyncDataInterceptor implements Interceptor{
}catch(Exception e){
e.printStackTrace();
logger.error("syncDataInterceptor拦截器内部程序出现异常信息"+e.getMessage());
logger.error("syncDataInterceptor拦截器内部程序出现异常信息",e);
}
}

View File

@@ -36,6 +36,7 @@ public class SyncStoredProcedure implements ICallback{
logger.info("调用存储过程任务结束");
} catch (Exception e){
logger.error("调用存储过程任务出现错误 存储过程名称"+proName+" 表名"+tableName+"参数 "+filedAndType+"------"+fileds);
logger.error("调用存储过程任务出现错误 ",e);
e.printStackTrace();
} finally{
if(conn!=null){

View File

@@ -6,7 +6,7 @@ import java.util.Date;
import java.util.List;
import org.apache.log4j.Logger;
import com.nms.interceptor.SyncMissionResultStatisticalInterceptor;
import com.alibaba.fastjson.JSON;
import com.jfinal.aop.Before;
import com.jfinal.plugin.activerecord.Db;
@@ -15,7 +15,7 @@ import com.jfinal.plugin.activerecord.Record;
import com.jfinal.plugin.activerecord.tx.Tx;
import com.nms.model.SyncDbInfo;
@Before({Tx.class})
@Before({SyncMissionResultStatisticalInterceptor.class,Tx.class})
public class SyncSlaveToMasterThread implements Runnable{
private Logger logger = Logger.getLogger(this.getClass());
private SyncDbInfo syncDbInfo;
@@ -244,6 +244,11 @@ public class SyncSlaveToMasterThread implements Runnable{
updateData.remove(record.getStr("id_name"));
}
Db.use("masterDataSource").batchUpdate(record.getStr("table_name"), "DETECTION_SET_INFO_ID,SEQ_ID",updateDatas, record.getInt("batch_size"));
}else if(record.getStr("table_name").contains("mission_result_table")){
for(Record updateData:updateDatas) {
updateData.remove(record.getStr("id_name"));
}
Db.use("masterDataSource").batchUpdate(record.getStr("table_name"), "mission_id,seq_id",updateDatas, record.getInt("batch_size"));
}else {
if(record.getStr("table_name").equals("detection_info_new")) {
for(Record updateData:updateDatas) {
@@ -295,8 +300,17 @@ public class SyncSlaveToMasterThread implements Runnable{
} catch (Exception e) {
logger.error("分库同步主库数据当前操作的异常表名为:"+errorTableName);
logger.error("分库数据同步主库发生错误 异常信息为:"+e.getMessage());
logger.error("分库数据同步主库发生错误 异常信息",e);
e.printStackTrace();
}
}
public SyncDbInfo getSyncDbInfo() {
return syncDbInfo;
}
public void setSyncDbInfo(SyncDbInfo syncDbInfo) {
this.syncDbInfo = syncDbInfo;
}
}

View File

@@ -250,6 +250,7 @@ public class SyncThread implements Runnable {
} catch (Exception e) {
logger.error("主库同步分库数据当前操作的异常表名为:"+errorTableName);
logger.error("主库数据同步分库发生错误 异常信息为:"+e.getMessage());
logger.error("主库数据同步分库发生错误 异常信息",e);
e.printStackTrace();
}
}