This content has been marked as final. Show 4 replies
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Pagination#Using_a_ScrollableCursor describes using a scrollable cursor to return entities. Since this is going through JPA (you didn't mention what api you are using to access EclipseLink) you will want to be careful to manage/clear your cache appropriately so it does not use all your available memory. You will probably want to make this query read-only, and clear the cache after a few iterations using em.clear().
http://wiki.eclipse.org/Introduction_to_EclipseLink_Queries_(ELUG)#Stream_and_Cursor_Query_Results describes and has links to using streams and cursors with the native EclipseLink read queries.
It seems that CursoredStream and ScrollableCursor are meant to handle large huge collections of data objects, rather than huge objects themselves.
I'm still not sure how to retrieve Blob as a stream using EclipseLink.
I would recommend unwrapping the EntityManager to get the JDBC Connection and accessing the Blob through JDBC.1 person found this helpful
You might also try mapping the Blob to a Blob field in your object. You would only be able to access this field while the connection is active though.
unwraping to the JDBC seems to do the trick. Thanks a lot