[oracle] Using procedures to get the cursor not working [message #1033598] |
Thu, 04 April 2013 12:17 |
Neikius Mising name Messages: 43 Registered: April 2011 |
Member |
|
|
So I tried to get cursor using this method (http://wiki.eclipse.org/EclipseLink/Examples/JPA/Pagination#Using_a_ScrollableCursor)
I just changed it a bit to use a named query that is a stored procedure call:
Query query = em.createNamedQuery("someprocedure");
query.setHint("eclipselink.cursor.scrollable", true);
ScrollableCursor scrollableCursor = (ScrollableCursor)query.getSingleResult();
List<Employee> emps = scrollableCursor.next(10);
The problem here is this:
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Invalid operation for forward only resultset : last
Error Code: 17075
All I am doing is calling .next() function, so why does it even try to scroll to the bottom? Any other way of doing it? The stored procedure returns cursor as the first out parameter. Oracle 10g, jdbc1.4 driver. Also eclipselink2.3.2 seems to be built in the Glassfish 3.1.2.2 server, I included 2.4. in the project but this one is what I get in the end.
Any insight into this is appreciated. But yea, I might have to make custom procedures to do pagination. Hope cache plays well with that.
[Updated on: Thu, 04 April 2013 12:19] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03521 seconds