Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NullPointerException in eclipselink 2.1.2 code : in eclipselink 2.1.2 code :
NullPointerException in eclipselink 2.1.2 code : [message #653161] Tue, 08 February 2011 17:39 Go to next message
jean marie turc is currently offline jean marie turcFriend
Messages: 6
Registered: January 2011
Junior Member
I want to use a cursor, so I try this:
Query query = em.createQuery(sql);
		query.setHint("eclipselink.cursor.scrollable", true);
		ScrollableCursor scrollableCursor = (ScrollableCursor) query.getSingleResult();
		boolean loop = true;
		while (loop) {
			List<Object> emps =;
			if (emps == null || emps.size() == 0)
				loop = false;

Before the end of the loop , I have this
	at org.eclipse.persistence.internal.queries.JoinedAttributeManager.processDataResults(
	at org.eclipse.persistence.queries.ScrollableCursor.retrieveNextObject(
	at org.eclipse.persistence.queries.ScrollableCursor.loadNext(

The code of the classe JoinedAttributeManager is :
 public AbstractRecord processDataResults(AbstractRecord row, Cursor cursor, boolean forward) {
        if (this.dataResultsByPrimaryKey == null) {
            this.dataResultsByPrimaryKey = new HashMap();
        AbstractRecord parentRow = row;
        List<AbstractRecord> childRows = new ArrayList<AbstractRecord>();
        int parentIndex = getParentResultIndex();
        // Must adjust for the parent index to ensure the correct pk is extracted.
        Vector trimedFields = new NonSynchronizedSubVector(row.getFields(), parentIndex, row.size());

and the nullpointer exception is on line 1074 , so;
 Vector trimedFields = new NonSynchronizedSubVector(row.getFields(), parentIndex, row.size());

because the variable row is null

I think is is a bug,
no ?

Re: NullPointerException in eclipselink 2.1.2 code : [message #653351 is a reply to message #653161] Wed, 09 February 2011 13:44 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1342
Registered: July 2009
Senior Member

Please file a bug for this issue. In the mean time, a workaround is to not use fetch joins for OneToMany relationships on results with a scrollable cursor.

Best Regards,
Previous Topic:deadlock on select
Next Topic:EclipseLink translating # to ? in native query
Goto Forum:

Current Time: Sat Apr 04 09:56:54 GMT 2020

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

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

Back to the top