码迷,mamicode.com
首页 > 其他好文 > 详细

Manual transaction control in Expression/Synchcronize Robot

时间:2015-01-22 21:51:43      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:

1. Expression robot中没有自动transaction控制,即如有需要,请手工添加;

  Test Scenario: 在expression中添加了update两笔part attribute的code如下

1 part1 = (WTPart) CustAttributeOperationUtil.setAttributeValue(part1, "customerParts", "SBB03");
2 PersistenceServerHelper.manager.update(part1);
3 
4 part1 = (WTPart) CustAttributeOperationUtil.setAttributeValue(part2, "customerParts", "SBB03"); 
5 PersistenceServerHelper.manager.update(part2);
6 throw new WTException("testWFExprRobotTransaction");

   结果:当异常发生时,part的customerParts已update生效。

2. Synchcronize Robot中有自动transaction控制,即不需要手工添加,而且在synchcronize完成之前如有异常发生,数据会自动rollback,如有加了,会报如下的exception:

    wt.pom.PersistenceException: The commit is mismatched. It corresponds to level "1". Current level is "0"

 

Manual transaction control in Expression/Synchcronize Robot

标签:

原文地址:http://www.cnblogs.com/windchill-fan/p/4242733.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!