Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink + Stream + Java 8(Having trouble reading out data from streams)
EclipseLink + Stream + Java 8 [message #1741577] Fri, 26 August 2016 02:10 Go to next message
Siddu R. is currently offline Siddu R.Friend
Messages: 1
Registered: August 2016
Junior Member

I am trying to execute a stored procedure on Sql Server using Java 8. The result is fetched as stream but whenever I try to iterate or do anything with result(stream), I get the following exception:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Invalid state, the ResultSet object is closed.
Error Code: 0
	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(
	at org.eclipse.persistence.queries.ScrollableCursor.getPosition(
	at org.eclipse.persistence.queries.ScrollableCursor.retrieveNextObject(
	at org.eclipse.persistence.queries.ScrollableCursor.loadNext(
	at org.eclipse.persistence.queries.ScrollableCursor.hasNext(
	at java.util.Iterator.forEachRemaining(
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(
	at 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at com.intellij.rt.execution.application.AppMain.main(
Caused by: java.sql.SQLException: Invalid state, the ResultSet object is closed.
	at net.sourceforge.jtds.jdbc.JtdsResultSet.checkOpen(
	at net.sourceforge.jtds.jdbc.JtdsResultSet.getRow(
	at com.zaxxer.hikari.pool.HikariProxyResultSet.getRow(
	at org.eclipse.persistence.queries.ScrollableCursor.getPosition(
	... 21 more

Re: EclipseLink + Stream + Java 8 [message #1742233 is a reply to message #1741577] Thu, 01 September 2016 03:21 Go to previous message
Clovis Wichoski is currently offline Clovis WichoskiFriend
Messages: 11
Registered: January 2016
Junior Member
This appears to be more how you deal and maintain this scenario, how you maintain the original conection you used to get the result and do process with stream? Its long transaction, its short? Maybe a database timeout? Tell us more about your case.
Previous Topic:CriteriaBuilder.quot of two SUM expression get wrong javaType and cant reach the correct constructor
Next Topic:EclipseLink / MySQL / Connector/J / UTF-8 Issue
Goto Forum:

Current Time: Wed Sep 19 02:51:16 GMT 2018

Powered by FUDForum. Page generated in 0.01540 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top