public class DayAtmRunHistory implements IBOTask {
@Autowired
private DayAtmRunHistoryService dayAtmRunHistoryService;
private static final Logger logger=LoggerFactory
.getLogger(DayAtmRunHistory.class);
/* (non-Javadoc)
* @see boframework.IBOTask#process(boframework.IBOTaskRecorder, java.lang.String[], boframework.data.TaskTrace)
*/
@Override
public void process(IBOTaskRecorder recoder, String[] parms, TaskTrace taskTrace)
throws Exception {
//dayAtmRunHistoryService.service(recoder, parms, taskTrace);
logger.info("DayAtmRunHistory entry!");
System.out.println(taskTrace==null);
if(!dayAtmRunHistoryService.initData(recoder, parms, taskTrace)){
String info="数据初始化校验失败!";
dayAtmRunHistoryService.recoderTraceInfo(TaskInfo.FAILURE, info, taskTrace, recoder);
return;
}
System.out.println(dayAtmRunHistoryService.taskTrace==null);
initData方法为dayAtmRunHistoryService父类ATaskService中执行
public boolean initData(IBOTaskRecorder recoder, String[] parms,
TaskTrace taskTrace) {
this.recoder = recoder;
this.taskTrace = taskTrace;
}
执行后竟然发现 打印为true,而实际上taskTrace 已经赋值过了。经反复测试,发现对dayAtmRunHistoryService去除spring事物管理的时候打印为false.由此判断是spring事物管理的原因造成的。