DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Yuzkan Mehmedali
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

NPE when setting max results for a query

Created: 03/Sep/12 03:06 PM   Updated: 27/Sep/12 04:00 PM   Resolved: 24/Sep/12 08:10 PM
Component/s: Code Structure
Affects Version/s: 3.1.0.release
Fix Version/s: None

Tapestry 5.1
JTDS 1.2.6

Datastore: Microsoft SQL Server

 Description  « Hide
The code I'm trying to execute looks like this:

Query query = em.createQuery(queryString);
if (initialLoad)

this.items = query.getResultList();

System.out.println("=======================> " + query);
System.out.println("=======================> " + query.getClass().getName());
System.out.println("=======================> " + this.items.size());

I'm getting an exception:

If I disable the query.setMaxResults(N) lines it works and the result is not empty.

This code used to work with version 2 of datanucleus but after uprgading to 3.1.0.release it fails.

Andy Jefferson added a comment - 04/Sep/12 09:23 AM
Valid testcase as per the docs and front page of JIRA is missing.

Andy Jefferson made changes - 04/Sep/12 09:23 AM
Field Original Value New Value
Priority Major [ 3 ] Incomplete [ 6 ]
Chris Colman added a comment - 06/Sep/12 01:34 AM
Is it happening during getResultList or during this.items.size() in your System out?

It's hard to tell without a full stack trace.

Yuzkan Mehmedali added a comment - 06/Sep/12 09:10 AM
It happens during this.items.size()

Andy Jefferson added a comment - 24/Sep/12 08:10 PM
No testcase provided so no way of reproducing this. Obviously if, at some point, you follow the problem reporting guide at and generate a testcase that shows this then this can be reopened, but until that time will remain closed since all of our tests, and all of those in the JPA TCK don't show any such thing.

Andy Jefferson made changes - 24/Sep/12 08:10 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Cannot Reproduce [ 5 ]
Andy Jefferson made changes - 27/Sep/12 04:00 PM
Status Resolved [ 5 ] Closed [ 6 ]