Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Scrollable ResultSet Exception "End of Stream"(Scrollable ResultSet Example)
Scrollable ResultSet Exception "End of Stream" [message #1023638] Sun, 24 March 2013 16:17 Go to next message
Eclipse UserFriend
I'm getting a Exception Description: An attempt to read beyond the end of stream occurred. Trying to read a resultset using a scrollable cursor. I could not get the eclipselink example working using my entity:

Query query = em.createQuery("SELECT e FROM Employee e ORDER BY e.lastName ASC, e.firstName ASC");
query.setHint("eclipselink.cursor.scrollable", true);
ScrollableCursor scrollableCursor = (ScrollableCursor)query.getSingleResult();
List<Employee> emps = scrollableCursor.next(10);

Here is my code:

Query query = this.dbConn.createQuery("SELECT o FROM OrderSuppressionRecords o");
query.setHint("eclipselink.cursor.scrollable", true);
ScrollableCursor cursor = (ScrollableCursor)query.getSingleResult();

while (cursor.hasNext() == false)
{
OrderSuppressionRecords record = (OrderSuppressionRecords)cursor.next();
... Other Processing Code
}

Is there a good example that works with EclipseLink 2.3.2?

[Updated on: Sun, 24 March 2013 16:46] by Moderator

Re: Scrollable ResultSet Exception "End of Stream" [message #1023932 is a reply to message #1023638] Mon, 25 March 2013 09:39 Go to previous message
Eclipse UserFriend
Just looking at your code, while (cursor.hasNext() == false) is incorrect as you want to only go through the loop when it is true.

Assuming this is a cut and paste error, check the size first by issuing a "SELECT COUNT(o) FROM OrderSuppressionRecords o" first and keep track of how many results you process before you get a problem.

Best Regards,
Chris
Previous Topic:@XmlInverseReference back pointer not set on unmarshalling
Next Topic:Batch fetch for type IN results in sql exception
Goto Forum:
  


Current Time: Wed Jul 23 14:19:12 EDT 2025

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

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

Back to the top