提交 13868f3d 编写于 作者: hebao@lab.ibiz5.com's avatar hebao@lab.ibiz5.com

构建结果批量保存支持大小设置

上级 abe69bf2
...@@ -40,6 +40,11 @@ public class ExecResultExService extends ExecResultServiceImpl { ...@@ -40,6 +40,11 @@ public class ExecResultExService extends ExecResultServiceImpl {
@Value("${defaultResultTableName:IBZRULERESULT}") @Value("${defaultResultTableName:IBZRULERESULT}")
private String Default_ResultTableName; private String Default_ResultTableName;
@Value("${ibiz.execResult.saveBatchSize:500}")
private int saveBatchSize;
@Value("${ibiz.execResult.deleteBatchSize:500}")
private int deleteBatchSize;
@Autowired @Autowired
@Lazy @Lazy
public IRuleEngineService engineService; public IRuleEngineService engineService;
...@@ -88,7 +93,7 @@ public class ExecResultExService extends ExecResultServiceImpl { ...@@ -88,7 +93,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
if (execResults.size() > 0 && idArray.length==3) { if (execResults.size() > 0 && idArray.length==3) {
for (ExecResult execResult : execResults) { for (ExecResult execResult : execResults) {
tempExecResults.add(execResult); tempExecResults.add(execResult);
if (tempExecResults.size() >= 500) { if (tempExecResults.size() >= saveBatchSize) {
saveResultBatch(tempExecResults, idArray[1] , idArray[2]); saveResultBatch(tempExecResults, idArray[1] , idArray[2]);
tempExecResults.clear(); tempExecResults.clear();
} }
...@@ -142,7 +147,7 @@ public class ExecResultExService extends ExecResultServiceImpl { ...@@ -142,7 +147,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
if (execResults.size() > 0 && idArray.length==3) { if (execResults.size() > 0 && idArray.length==3) {
for (ExecResult execResult : execResults) { for (ExecResult execResult : execResults) {
tempExecResults.add(execResult); tempExecResults.add(execResult);
if (tempExecResults.size() >= 500) { if (tempExecResults.size() >= deleteBatchSize) {
clearResultBatch(tempExecResults, idArray[1] , idArray[2]); clearResultBatch(tempExecResults, idArray[1] , idArray[2]);
tempExecResults.clear(); tempExecResults.clear();
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册