首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

ofbiz中应用事务

2012-10-06 
ofbiz中使用事务?在使用ofbiz中经常会出现下面的后台日志ERROR: Cannot do afind that returns an EntityL

ofbiz中使用事务

?

在使用ofbiz中经常会出现下面的后台日志

ERROR: Cannot do afind that returns an EntityListIterator with no transaction in place. Wrap thiscall in a transaction.

?

在deletagor代码上下加上

TransactionUtil.begin().

TransactionUtil.commit()

TransactionUtil.rollback()

即可

?

?

1 楼 liuyajun 2010-02-08   delegator中的方法里面(比如delegator.create())就自带有调用TransactionUtil类里的方法。begin,rollback,commit
  如果是自己写的一个方法里面 会调用多个其他操作数据的方法 怎么使用事务呢 2 楼 thoughtfly 2010-02-11   liuyajun 写道delegator中的方法里面(比如delegator.create())就自带有调用TransactionUtil类里的方法。begin,rollback,commit
  如果是自己写的一个方法里面 会调用多个其他操作数据的方法 怎么使用事务呢
呵呵,那是你没有遇到而已,我是在用find查询多表关联查询的时候遇到的,也花了我不少的时间去搜索信息和解决。好像是自己写java实现时,有的时候会超出ofbiz自己所写的事务包含,就像是ssh框架中,service层证事务中调用事务有时也会出问题的。

热点排行