Community
Participate
Working Groups
After adding resource, root resource appears in dirty object set, but it doesn't appear among transaction's objects.
Created attachment 189254 [details] test case
Problem here is that the PushTransaction fetches affected objects by CDOID. When the rootResource gets fetched by CDOID, it doesn't get registered... a bug indeed, methinks. Patch coming up.
Created attachment 191983 [details] Patch v1 (including testcase) Fix and a simpler testcase that demonstrates the problem without using a PushTx.
Hmm... this patch introduces some subtle breakage. Problem is as follows: Fetching a resource triggers an iteration over the resources already in the resourceSet, to compare their URI's with the URI being fetched. This means getURI gets called on every resource. This triggers construction of a resource's path, which in turn requires its 'folder' to be fetched. This folder is its container, which could be the rootResource. When the rootResource gets fetched (and the patch for this Bugzilla in place), it gets added to the resources collection in the resourceSet... But that's the collection being iterated over, so a ConcurrentModificationEx gets thrown...
To be more succinct: getting a CDOResource's URI might trigger the loading of additional resources, and that's problematic if a collection of resources is being iterated over. I think it's a weakness in our logic that the loading of additional resources is necessary just to construct a URI... but changing this would require modifications to the core model, i.e. to CDOResourceNode. I'm not sure if that's desirable. For now, I'll provide a patch containing a workaround that ensures that the URI's of all resource's in the resourceSet can be constructed without triggering any further resource loading.
Created attachment 191992 [details] Patch v2 (including testcase)
Created attachment 192437 [details] Patch v3
Committed revision 7578.
Available in R20110608-1407