Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Cursor result with JPA query and dynamic fetch group
Cursor result with JPA query and dynamic fetch group [message #721894] Sat, 03 September 2011 09:13 Go to next message
attila Mising name is currently offline attila Mising name
Messages: 45
Registered: April 2010
Member
Hello,

Is there any known issue for the following scenario ?

1) Create a jpa query "select .... "
2) Add a dynamic fecth group
FetchGroup fg = new FetchGroup("default");
fg.setShouldLoad(true);
// add attributes
query.setHint(QueryHints.FETCH_GROUP, fg);

3) read with a Cursor

query.setHint(QueryHints.CURSOR, true)
.setHint(QueryHints.CURSOR_INITIAL_SIZE, 30)
.setHint(QueryHints.CURSOR_PAGE_SIZE, 30)
.setHint(QueryHints.READ_ONLY, HintValues.TRUE)
.setFirstResult(bld.getResultStart())
.setMaxResults(bld.getResultSize());
			
Cursor c = query.unwrap(JpaQuery.class).getResultCursor();		



With both versions which i tried (2.3.0 and 2.3.0-RC4) it crashes with the error below.

If it is called with a regular result list works :
List<E> list = bld.createQuery()
.setFirstResult(bld.getResultStart())
.setMaxResults(bld.getResultSize())
.getResultList();	


With Cursor works if i remove the fetch-group

Here is the error:


java.lang.NullPointerException 
[2011-09-03 16:12:02.974] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.internal.sessions.AbstractSession$1.iterate(AbstractSession.java:4530) 
[2011-09-03 16:12:02.974] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.internal.descriptors.DescriptorIterator.startIterationOn(DescriptorIterator.java:666) 
[2011-09-03 16:12:02.974] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.internal.sessions.AbstractSession.load(AbstractSession.java:4559) 
[2011-09-03 16:12:02.974] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1114) 
[2011-09-03 16:12:02.974] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:829) 
[2011-09-03 16:12:02.975] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1056) 
[2011-09-03 16:12:02.975] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:390) 
[2011-09-03 16:12:02.975] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2816) 
[2011-09-03 16:12:02.975] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1501) 
[2011-09-03 16:12:02.975] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1483) 
[2011-09-03 16:12:02.975] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1457) 
[2011-09-03 16:12:02.975] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:485) 
[2011-09-03 16:12:02.975] ERROR "http-bio-8089"-exec-2       System.err                                                        	at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultCursor(EJBQueryImpl.java:661) 
[2011-09-03 16:12:02.975] ERROR "http-bio-8089"-exec-2       System.err                                                        	at net.nan21.dnet.core.presenter.service.AbstractDsService.doExport(AbstractDsService.java:450) 



Thank you

Re: Cursor result with JPA query and dynamic fetch group [message #722789 is a reply to message #721894] Tue, 06 September 2011 13:38 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Seems to be a bug with usage of fetch groups and a cursor. Please log the bug and vote for it.


James : Wiki : Book : Blog : Twitter
Re: Cursor result with JPA query and dynamic fetch group [message #724359 is a reply to message #722789] Mon, 12 September 2011 03:27 Go to previous messageGo to next message
attila Mising name is currently offline attila Mising name
Messages: 45
Registered: April 2010
Member
Thank you James,

Filed bug :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=357344
(no subject) [message #724362 is a reply to message #722789] Mon, 12 September 2011 03:27 Go to previous message
attila Mising name is currently offline attila Mising name
Messages: 45
Registered: April 2010
Member
Thank you James,

Filed bug :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=357344
Previous Topic:Transaction Marked for Rollback -- No exceptions logged ?? possible bug?
Next Topic:(no subject)
Goto Forum:
  


Current Time: Wed Aug 20 10:53:41 EDT 2014

Powered by FUDForum. Page generated in 0.01505 seconds