Project: Birt
Bug 305308 Canceling task issue
Reported: 2010-03-10 06:49:42 | Status: verified fixed

When canceling a run task I get this error (and other like this): (BIRT 2.5.1) SEVERE: Cannot get the string value from column: 2. Cannot get string value in the result set. SQL error #1: Operation not allowed after ResultSet closed org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot get string value in the result set. SQL error #1: Operation not allowed after ResultSet closed ; java.sql.SQLException: Operation not allowed after ResultSet closed at org.eclipse.birt.report.data.oda.jdbc.ResultSet.getString(Re sultSet.java:215) at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaRe sultSet.getString(OdaResultSet.java:246) at org.eclipse.birt.data.engine.odaconsumer.ResultSet.getString (ResultSet.java:267) at org.eclipse.birt.data.engine.odaconsumer.ResultSet.fetch(Res ultSet.java:180) at org.eclipse.birt.data.engine.executor.cache.OdiAdapter.fetch (OdiAdapter.java:142) at org.eclipse.birt.data.engine.executor.cache.RowResultSet.nex t(RowResultSet.java:104) at org.eclipse.birt.data.engine.executor.transform.SimpleResult Set.next(SimpleResultSet.java:341) at org.eclipse.birt.data.engine.impl.ResultIterator.hasNextRow( ResultIterator.java:493) at org.eclipse.birt.data.engine.impl.ResultIterator.next(Result Iterator.java:432) at org.eclipse.birt.data.engine.impl.ResultIterator.close(Resul tIterator.java:888) at org.eclipse.birt.data.engine.impl.ResultIterator$1.dataEngin eShutdown(ResultIterator.java:176) at org.eclipse.birt.data.engine.impl.DataEngineImpl.shutdown(Da taEngineImpl.java:527) at org.eclipse.birt.report.data.adapter.impl.DataRequestSession Impl.shutdown(DataRequestSessionImpl.java:405) at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine .shutdown(DataGenerationEngine.java:139) at org.eclipse.birt.report.engine.executor.ExecutionContext.clo seDataEngine(ExecutionContext.java:835) at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTas k.java:246) at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask. java:82) at eee.executeReport(eee.java:72) at eee.main(eee.java:31) Caused by: java.sql.SQLException: Operation not allowed after ResultSet closed at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:105 5) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956 ) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926 ) at com.mysql.jdbc.ResultSetImpl.checkClosed(ResultSetImpl.java: 768) at com.mysql.jdbc.ResultSetImpl.checkRowPos(ResultSetImpl.java: 812) at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl .java:5528) at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:54 48) at org.eclipse.birt.report.data.oda.jdbc.ResultSet.getString(Re sultSet.java:210) ... 18 more I use a progress monitor for the task and when some maximum number of rows is reached, I cancel the task; I've tried to cancel in the same thread, or use a separate thread just like here: http:// demo.spars.info/j/frameset.cgi?compo_id=209484&packagena me=org.eclipse.birt.report.engine.api&componame=org.ecli pse.birt.report.engine.api.EngineTaskCancelTest$RenderTaskTr iggerCancel&mode=frameset&ref=5&start_class=0&am p;location=1111111111111111111&MORPHO=1&LANG=1&c ompo_id=208747 The same errors appear in both cases. Even-though the task is canceled I maybe doing something wrong because it seems to me that the canceling process is not a clean one. This error appears always in the engine log, but from time to time the method run(rptDocument) throws an EngineExcetion, too.

Files changed in fix:
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/ResultIterator.java