Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Performance problem when doing merge(The cache does not match my dehibernated objects (giving bad performance).)
Performance problem when doing merge [message #1773044] Wed, 20 September 2017 18:07 Go to next message
magnus persson is currently offline magnus perssonFriend
Messages: 3
Registered: January 2017
Junior Member
I am using eclipselink and have a performance-problem when doing merge(). When querying i perform a 'dehibernate'-operation
and convert all IndirectList to ArrayList (removing all proxy-objects). This is sent to the client and back again (using GWT). When the merge is executed eclipselink does not find the original objects in the cache (this makes the merge 20 times slower (it refetches everyting from the DB)).
Is there a way to have eclipselink return ArrayList-objects and not the IndirectList (I do not need lazy-loading on the client) ?
I have tried disabling weaving (it did not help).
Or is it possible to modify the cache to accept my patched objects as equal to the ones in the cache ?
This problem did not appear when using hibernate.

Best regards, Magnus
Re: Performance problem when doing merge [message #1773367 is a reply to message #1773044] Tue, 26 September 2017 21:29 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1275
Registered: July 2009
Senior Member
Collections are lazy by default and do not require weaving as EclipseLink can use its own collection implementation without affecting your entity class. Setting your collection relationship to be eager will avoid EclipseLink returning this indirect collection implementation.

As for the problem with merge not finding the original objects - you'll have to give more details. The objects should be there if read in using the same context, unless you've disabled the cache that is. You can always query for the object directly, using fetch-joins or batch fetching query hints to make this read in more efficient, but EclipseLink requires the objects in memory somehow to be able to determine what has changed (the point of the merge call). If you know what might have changed, you might write your own merge method that takes the changes from your serialized instance and modified the managed instance.

Best Regards,
Chris
Re: Performance problem when doing merge [message #1773414 is a reply to message #1773367] Wed, 27 September 2017 15:12 Go to previous message
magnus persson is currently offline magnus perssonFriend
Messages: 3
Registered: January 2017
Junior Member
I managed to solve the problem (it was a bad relationship with fetch everything into memory). The cache was not active as i used multitenant-mode. I was able to enable the cache (I had to use a factory for each separate tenant-id). Is it possible to have the cache enabled using only one factory ? I do not know if my solution scales well when using 100 tenants at the same time (will it run out of memory ?)
Previous Topic:ConcurrentModificationException using ReadObjectquery with EclipseLink 2.6.4
Next Topic:How to use JPA and Hibernate together with Tomcat 8?
Goto Forum:
  


Current Time: Tue Dec 12 10:42:33 GMT 2017

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

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