Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:17 Go to next message
Neikius Mising name is currently offline Neikius Mising nameFriend
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

Re: [oracle] Using procedures to get the cursor not working [message #1037405 is a reply to message #1033598] Tue, 09 April 2013 14:15 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Please include the exception stack trace. Also try the latest release, 2.4.1.


James : Wiki : Book : Blog : Twitter
Re: [oracle] Using procedures to get the cursor not working [message #1038761 is a reply to message #1037405] Thu, 11 April 2013 09:33 Go to previous messageGo to next message
Neikius Mising name is currently offline Neikius Mising nameFriend
Messages: 43
Registered: April 2011
Member
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 13:13 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

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


James : Wiki : Book : Blog : Twitter
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: Fri Apr 26 11:13:53 GMT 2024

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

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

Back to the top