Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Can't I have two simultaneosly active Resultsets?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have an application that calls a method from a DAO class based on parameters provided by the user. The method returns an iterator based on a resultset. The main application works on that iterator and, for each item from it writes a line to a file on disk. Usually I have the resultset with thousands of lines which means my iterator and the resultset are active for a long time. As the execution of the application is assincronous (scheduled by Quartz) sometimes I have one active resultset whist trying to get a new one. That's the time when the problem arises. I'm getting the following error message:

java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@9aafb3 is still active. Only one streaming result set may be open and in use per-connection. Ensure that you have called .close() on any active result sets before attempting more queries.
at com.mysql.jdbc.MysqlIO.checkForOutstandingStreamingData(MysqlIO.java:2125)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1099)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1272)
at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1218)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2233)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2193)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2174)
at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:536)
at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:266)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:338)
at net.sf.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTransaction.java:104)
at net.sf.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:95)
at org.springframework.orm.hibernate.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:483)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:432)
at org.springframework.transaction.interceptor.TransactionAspectSupport.doCloseTransactionAfterThrowing(TransactionAspectSupport.java:259)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:60)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:596)
at br.com.stefanini.cobilling.criticado.modelo.negocio.GerenteExtracaoCriticados$$EnhancerByCGLIB$$e5ae0b1f.extrairCDRsRO(<generated>
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:324)
at br.com.stefanini.modelo.negocio.quartz.BeanMethodInvokerJob.executeInternal(BeanMethodInvokerJob.java:114)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:66)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)

What exactly does this message mean? Can't I have two simultaneosly active resultsets? I'm using MySql. Is this a MySql limitation?

Any help is welcome.

Thanks in advance.
[ September 06, 2005: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Damien,
I'm only guessing, but it looks like a limitation of mySQL or DBCP.

There is definitely no such limitation when working with Oracle.

Good Luck,
Avi.
 
Are you here to take over the surface world? Because this tiny ad will stop you!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic