Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL specific issue - java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@3ef4415f is still active. No statements may be issued when any streaming result sets a re open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries. #301

Closed
rbygrave opened this issue May 29, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@rbygrave
Copy link
Member

root cause

java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@3ef4415f is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
at com.mysql.jdbc.MysqlIO.checkForOutstandingStreamingData(MysqlIO.java:3361)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2825)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2156)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2323)
at com.avaje.ebeaninternal.server.lib.sql.ExtendedPreparedStatement.executeQuery(ExtendedPreparedStatement.java:132)
at com.avaje.ebeaninternal.server.query.CQuery.prepareBindExecuteQueryWithOption(CQuery.java:325)
at com.avaje.ebeaninternal.server.query.CQuery.prepareBindExecuteQuery(CQuery.java:274)
at com.avaje.ebeaninternal.server.query.CQueryEngine.findMany(CQueryEngine.java:165)
at com.avaje.ebeaninternal.server.query.DefaultOrmQueryEngine.findMany(DefaultOrmQueryEngine.java:80)
at com.avaje.ebeaninternal.server.core.OrmQueryRequest.findList(OrmQueryRequest.java:284)
at com.avaje.ebeaninternal.server.core.DefaultServer.findList(DefaultServer.java:1372)
at com.avaje.ebeaninternal.server.core.DefaultBeanLoader.loadBean(DefaultBeanLoader.java:335)
at com.avaje.ebeaninternal.server.core.DefaultServer.loadBean(DefaultServer.java:468)
at com.avaje.ebeaninternal.server.loadcontext.DLoadBeanContext.loadSecondaryQuery(DLoadBeanContext.java:94)
at com.avaje.ebeaninternal.server.loadcontext.DLoadContext.executeSecondaryQueries(DLoadContext.java:109)
at com.avaje.ebeaninternal.server.core.OrmQueryRequest.executeSecondaryQueries(OrmQueryRequest.java:82)
at com.avaje.ebeaninternal.server.query.CQueryIteratorWithBuffer.hasNext(CQueryIteratorWithBuffer.java:46)
...

@rbygrave rbygrave added the bug label May 29, 2015
@rbygrave rbygrave self-assigned this May 29, 2015
@rbygrave rbygrave added this to the 4.6.3 milestone May 29, 2015
@rbygrave rbygrave changed the title java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@3ef4415f is still active. No statements may be issued when any streaming result sets a re open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries. MySQL specific issue - java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@3ef4415f is still active. No statements may be issued when any streaming result sets a re open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries. May 29, 2015
@rbygrave
Copy link
Member Author

So this issue is specific to MySql and findIterate() (and the variations - findEach() findEachWhile() etc.

There is a limitation in the MySql jdbc driver that a single connection can't stream a resultSet ... and perform other queries. No other jdbc drivers are known to have this limitation.

@rbygrave
Copy link
Member Author

Now for a EbeanORM iteration query (findIterate(), findEach(), findEachWhile() etc) there can be 'query joins' executed in order to build other parts of the object graph in a batch fashion (100 at a time etc). Now these 'query join' sql queries get this error with MySql jdbc drivers.

The 'fix' is to detect that the database platform has this limitation, and to use other transactions for the 'query joins' (but ensuring that the same persistence context is used of course).

rbygrave added a commit that referenced this issue May 29, 2015
… set com.mysql.jdbc.RowDataDynamic@3ef4415f is still active. No statements may be issued when any streaming result sets a re open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries
@reddyjbaddam
Copy link

reddyjbaddam commented Oct 17, 2017

This issue is related with driver class name you need to specify ,It should work.Its worked for me

Try this --driver com.mysql.jdbc.Driver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants