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.

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.

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 ?)