Ofbiz中迭代器的事物

ofbiz中迭代器的使用需要控制事务,事务的控制一般由服务来控制,外层服务控制事务,设置事务的时间
	<service name="***" engine="java"
		location="***" invoke="***"
		transaction-timeout = "36000000">

	</service>


如果手工控制事务不当,比如说取完迭代器就提交,会报下面的错误:

2010-07-28 16:43:30,373 (default-invoker-Thread-105) [                       ?:?  :ERROR] 迭代器处理异常
com.bosent.entity.GenericEntityException: SQL语句([jcc][t4][10120][10898][3.53.95] 操作无效:已关闭 result set。 ERRORCODE=-4470, SQLSTATE=null)
	at com.bosent.entity.util.EntityListIterator.last(EntityListIterator.java:136)
	at com.bosent.risk.RiskClassificationServices.processIteratorData(Unknown Source)
	at com.bosent.risk.RiskClassificationServices.riskClassificationService(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at com.bosent.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:96)
	at com.bosent.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:54)
	at com.bosent.service.ServiceDispatcher.runSync(ServiceDispatcher.java:659)
	at com.bosent.service.ServiceDispatcher.runSync(ServiceDispatcher.java:282)
	at com.bosent.service.GenericDispatcher.runSync(GenericDispatcher.java:166)
	at com.bosent.service.job.GenericServiceJob.exec(GenericServiceJob.java:97)
	at com.bosent.service.job.JobInvoker.run(JobInvoker.java:270)
	at java.lang.Thread.run(Thread.java:725)
Caused by: com.ibm.db2.jcc.b.SqlException: [jcc][t4][10120][10898][3.53.95] 操作无效:已关闭 result set。 ERRORCODE=-4470, SQLSTATE=null
	at com.ibm.db2.jcc.b.bd.a(bd.java:660)
	at com.ibm.db2.jcc.b.bd.a(bd.java:60)
	at com.ibm.db2.jcc.b.bd.a(bd.java:103)
	at com.ibm.db2.jcc.b.vl.Eb(vl.java:4176)
	at com.ibm.db2.jcc.b.vl.o(vl.java:1356)
	at com.ibm.db2.jcc.b.vl.last(vl.java:1892)
	at org.apache.commons.dbcp.DelegatingResultSet.last(DelegatingResultSet.java:329)
	at org.apache.commons.dbcp.DelegatingResultSet.last(DelegatingResultSet.java:329)
	at com.bosent.entity.util.EntityListIterator.last(EntityListIterator.java:125)

你可能感兴趣的:(java,apache,db2,IBM,sun)