Project

General

Profile

Actions

Bug #35

closed

Multi datasets and JPA exception

Added by Anonymous over 12 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Start date:
2011-10-06
Due date:
% Done:

0%

Estimated time:

Description

The creation of a multi-dataset (currently there is only the sky emission) is happening fine. The related transaction completes without any exception. The next time a transaction happens though (like when trying to save the site) it fails because it tries to recreate the related entries in the DATASET_OPTION_MAP (see attached file for the stacktrace).


Files

stacktrace (8.98 KB) stacktrace Anonymous, 2011-10-06 17:40
Actions #1

Updated by Anonymous over 12 years ago

  • Status changed from New to In Progress
  • Priority changed from Normal to Low

I spend a fair amount of time trying to trace this down (unsuccessfully). Because of a tight deadline for the ADASS conference I did the following workaround, which will be available in the 0.2.3 version:

- At the SessionManagerImpl class, at the beginning of the saveSite method I started and rolled back a transaction. This actually causes the exception to happen (it happens only once), so after that the site can be saved normally. This though has the side-effect that it "brakes" a little bit the eclipse link. More precisely, when the entity manager merges the site entities it returns a new instance.

-To fix the side-effect issue, I changed the SiteListenerImpl class, at the end of the saveCurrentSite method, to load from the database the site and set it as the current site.

Note that THIS IS ONLY A WORKAROUND!!! I leave the ticket open and set the priority to Low. I will investigate more to fix the real bug (and undo the workaround) after ADASS conference.

Actions #2

Updated by Anonymous over 12 years ago

Continuing the workaround, I modified also the PluginCommunicatorImpl class to try a second time when creating a multi-dataset fails with an exception. If the creation fails again, then the exception is propagated.

Actions #3

Updated by Anonymous over 12 years ago

Did one more modification for implementing the workaround. In the SiteListenerImpl class, at the ImportSiteThread.

Actions #4

Updated by Anonymous over 12 years ago

Spent some more time debuging this... It turns out that this is a problem with EclipseLink. More precisely, it cannot handle ManyToMany relationships which use a key and it fails if two of the values are the same (class org.eclipse.persistence.descriptors.chengetracking.DeferredChangeDetectionPolicy method createObjectChangeSetThroughComparison). Because the ETC is reusing the datasets when they contain the same data it was failing with this error. For a quick fix for ADASS I removed the option of using the same dataset if it contains the same data, by just returning nothing at the method findDatasetEntityEntities(Long hash) of the class DatasetEntityJpaController. This way the ETC will not find the datasets containing the same data and will create a duplicate.

I must contact EclipseLink and report this bug. I will do that after ADASS, so I leave the bug open.

Actions #5

Updated by Christian Surace almost 7 years ago

  • Status changed from In Progress to Closed
Actions

Also available in: Atom PDF