Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » indirect resultlist
indirect resultlist [message #389758] Wed, 01 July 2009 14:23 Go to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 807
Registered: July 2009
Senior Member
I'm running into the situation where a query.getResultList() causes an out-of-memory exception because the resultlist is too large (7500 bills). I figure reading all the entities in memory is not required, because the actual contents of the list is never 100% used; the view only shows those records that are visible and the navigation components only needs as far as is navigated.

So I'm trying to bolt a sort of lazy loading onto the result list; basically reading the resultset on demand in blocks using setFirstResult and setMaxResulst and caching read entities.

Then I started to wonder; why doesn't the ResultList do this in the first place? As long as an entity is strongly referenced in the application it will also stay in the cache, as soon as no one has interest anymore, it can be GCed and re-read when it is asked for.

Or does this have to the with disabling eclipselink.persistence-context.reference-mode=weak?
Re: indirect resultlist [message #389781 is a reply to message #389758] Thu, 02 July 2009 14:21 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Normal queries are expected to return real lists, that can be serialized,
etc. very large queries are the exceptional case. For very large queries
you can use tge firstResult/maxResult or use a
CursoredStream/ScrollableCursor (you can set this through Query hints).

In TopLink we did have a CursoredCollection implementation at one point,
but this is not in EclipseLink, so if this is something you desire you
could log an enhancement request for it.

---
James
http://www.nabble.com/EclipseLink---Users-f26658.html


James : Wiki : Book : Blog : Twitter
Re: indirect resultlist [message #389783 is a reply to message #389781] Thu, 02 July 2009 17:06 Go to previous message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 807
Registered: July 2009
Senior Member
> so if this is something you desire you
> could log an enhancement request for it.

Oh oh... Bugzilla has a problem. Send an email to the webmaster.


DBD::mysql::db do failed: Table './bugs/bugs_activity' is marked as crashed and should be repaired at /home/data/httpd/bugs.eclipse.org/html/bugzilla-2.20/Bugzill a/DB/Mysql.pm line 209
Bugzilla::DB::Mysql::bz_lock_tables('Bugzilla::DB::Mysql=HAS H(0x555558e1eb60)', 'bugs WRITE', 'bug_group_map WRITE', 'longdescs WRITE', 'cc WRITE', 'keywords WRITE', 'dependencies WRITE', 'bugs_activity WRITE', 'fielddefs READ', ...) called at /home/data/httpd/bugs.eclipse.org/html/bugzilla-2.20/Bugzill a/Bug.pm line 285
Bugzilla::Bug::create('Bugzilla::Bug', 'HASH(0x5555576622a0)') called at /home/data/httpd/bugs.eclipse.org/html/bugzilla-2.20/post_bu g.cgi line 166
ModPerl::ROOT::Bugzilla::ModPerl::ResponseHandler::home_data _httpd_bugs_2eeclipse_2eorg_html_bugzilla_2d2_2e20_post_bug_ 2ecgi::handler('Apache2::RequestRec=SCALAR(0x55555868e570)') called at /usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/M odPerl/RegistryCooker.pm line 204
eval {...} called at /usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/M odPerl/RegistryCooker.pm line 204
ModPerl::RegistryCooker::run('Bugzilla::ModPerl::ResponseHan dler=HASH(0x555558d03560)') called at /usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/M odPerl/RegistryCooker.pm line 170
ModPerl::RegistryCooker::default_handler('Bugzilla::ModPerl: :ResponseHandler=HASH(0x555558d03560)') called at /usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/M odPerl/Registry.pm line 31
ModPerl::Registry::handler('Bugzilla::ModPerl::ResponseHandl er', 'Apache2::RequestRec=SCALAR(0x55555868e570)') called at /home/data/httpd/bugs.eclipse.org/html/bugzilla-2.20/mod_per l.pl line 96
Bugzilla::ModPerl::ResponseHandler::handler('Bugzilla::ModPe rl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x55555868e570)') called at -e line 0
eval {...} called at -e line 0
Previous Topic:losing the JDBC connection
Next Topic:[Teneo] Rollback with a EclipseLinkResourceImpl
Goto Forum:
  


Current Time: Wed Dec 17 19:56:12 GMT 2014

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

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