Bug 357344 - Cursor result with JPA query and dynamic fetch group
Summary: Cursor result with JPA query and dynamic fetch group
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P2 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-12 03:21 EDT by attila Mising name CLA
Modified: 2022-06-09 10:24 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description attila Mising name CLA 2011-09-12 03:21:06 EDT
when using jpa query with dynamic fetch groups the cursor result does not work

Steps: 

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 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();		

 - The cursor works if no fetch-group is specified
 - With fetch-group works the regular .getResultList();



The error log: 




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)
Comment 1 attila Mising name CLA 2011-09-12 03:22:46 EDT
see forum post:
http://www.eclipse.org/forums/index.php/t/238330/
 (cleaner code view :) )
Comment 2 Tom Ware CLA 2011-10-13 13:27:16 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:15:57 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:24:18 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink