Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » [oracle] Using procedures to get the cursor not working
[oracle] Using procedures to get the cursor not working [message #1033598] Thu, 04 April 2013 08:17 Go to next message
Eclipse UserFriend
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 08:19] by Moderator

Re: [oracle] Using procedures to get the cursor not working [message #1037405 is a reply to message #1033598] Tue, 09 April 2013 10:15 Go to previous messageGo to next message
Eclipse UserFriend
Please include the exception stack trace. Also try the latest release, 2.4.1.
Re: [oracle] Using procedures to get the cursor not working [message #1038761 is a reply to message #1037405] Thu, 11 April 2013 05:33 Go to previous messageGo to next message
Eclipse UserFriend
How do you convince glassfish to use the newest release? I have it in my project but it takes its own eclipselink not the one included in the EAR.

This is otherwise an Oracle thing as far as I know, not returning the correct type of cursor. But I guess eclipselink ain't all that smart at it.
Re: [oracle] Using procedures to get the cursor not working [message #1042458 is a reply to message #1038761] Tue, 16 April 2013 09:13 Go to previous message
Eclipse UserFriend
The easiest way is to just replace the eclipselink jars in Glassfish with the newer ones. But you should also be able to override the jars in your ear.

See,
https://blogs.oracle.com/GlassFishPersistence/entry/updating_eclipselink_bundles_in_glassfish

http://stackoverflow.com/questions/11530141/bundling-a-different-version-of-the-embedded-jpa-provider-in-your-ear
Previous Topic:[EclipseLink.Examples.Employee] How to configure java:global/employeeDS on GF4
Next Topic:ManyToMany mapping created when no mapping is specified
Goto Forum:
  


Current Time: Tue Jul 15 18:41:22 EDT 2025

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

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

Back to the top