Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Paging large record set with EclipseLink Query using Sybase runs out of memory

I'm not sure if Sybase supports pagination similar to Oracle.  If it does
please log a bug and include the SQL syntax required on Sybase.  You could
extend the Sybase platform with such syntax if it exists (please contribute
the patch if you do).  Or you could use the native SQL query in your code.

It is odd that you run out of memory with firstResult, it will basically
skip over the firstResult rows, so there should be nothing holding them in
memory, it could be a JDBC driver issue.  Make sure you create a new
EntityManager for each page query, and ensure you are using a weak cache. 
You may also try increasing your JVM memory.

You may also be able to page by some field in your object.  i.e. where
z.name > 'A' and z.name < 'C' (and page through A-Z).



gsilverman wrote:
> 
> Has anyone found a way to page a large record set in EclipseLink without
> running out of memory using Sybase?
> 
> I have a zip code entity, Zip, which basically maps to a zip table storing
> zip codes, city, state and country information with 100,000s of rows.
> 
> When I query using:  
>                
>                 String query = "select z from Zip z";
>                 Query q = entityManager.createQuery(query);
> 		q.setFirstResult(firstResult)
> 		.setMaxResults(100)
> 		.getResultList();
> 
> Everything is fine up to firstResult = 15000, but I get
> "java.lang.OutOfMemoryError: Java heap space"
> errors for firstResult greater than that.
> 
> I'm using Sybase as the underlying database, and I see in 
> http://wiki.eclipse.org/EclipseLink/Examples/JPA/Pagination
> wiki.eclipse.org/EclipseLink/Examples/JPA/Pagination  a workaround for
> Oracle. Does anyone have a fix for Sybase?
> 
> 
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Paging-large-record-set-with-EclipseLink-Query-using-Sybase-runs-out-of-memory-tp19655400p19669885.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top