[CDO/XText inthttps://www.eclipse.org/forums/index.php/mv/msg/441129/989287/#msg_989287
I use a XtextResourceSet with cdo URI on Eclipse Juno (4.2.1), on first
call to XtextResourceSet.getResource("cdo://repo1/Test/test.ecore",
true) it returns a CDOResource with a id equals to oid1 (temporary CDOID
to indicate that it is a CDOResource not yet commited to the server), in
the XtextResourceSet.getResource(URI,boolean) the code does not update
the uriResourceMap like does ResourceSetImpl.getResource(URI,boolean) at
the end. Consequently at the second call to
XtextResourceSet.getResource("cdo://repo1/Test/test.ecore", true) the
previously created CDOResource is not retreived from the uriResourceMap
then a new CDOResource is created for the same URI. Then on
CDOResource.save() (i.e. CDOTransaction.commit()) many exception occurs
because CDO complains about 2 CDOResources with the same URI. It seems a
bug in XtextResourceSet which does not update uriResourceMap. What do
you think about that?

Best Regards]]>2012-12-05T14:36:03-00:00Re: [CDO/XText inthttps://www.eclipse.org/forums/index.php/mv/msg/441129/989300/#msg_989300
> Hi Xtext community,
>
> I use a XtextResourceSet with cdo URI on Eclipse Juno (4.2.1), on first
> call to XtextResourceSet.getResource("cdo://repo1/Test/test.ecore",
> true) it returns a CDOResource with a id equals to oid1 (temporary CDOID
> to indicate that it is a CDOResource not yet commited to the server), in
> the XtextResourceSet.getResource(URI,boolean) the code does not update
> the uriResourceMap like does ResourceSetImpl.getResource(URI,boolean) at
> the end. Consequently at the second call to
> XtextResourceSet.getResource("cdo://repo1/Test/test.ecore", true) the
> previously created CDOResource is not retreived from the uriResourceMap
> then a new CDOResource is created for the same URI. Then on
> CDOResource.save() (i.e. CDOTransaction.commit()) many exception occurs
> because CDO complains about 2 CDOResources with the same URI. It seems a
> bug in XtextResourceSet which does not update uriResourceMap. What do
> you think about that?
>
> Best Regards

I see also that in case of ResourceSetImpl the uriResourceMap by default
is not initialized, equals to null, while in XtextResource it is
initialized with a empty map in constructor.]]>2012-12-05T14:57:06-00:00Re: [CDO/XText inthttps://www.eclipse.org/forums/index.php/mv/msg/441129/989348/#msg_989348
> Le 05/12/2012 15:36, Esteban DUGUEPEROUX a écrit :
>> Hi Xtext community,
>>
>> I use a XtextResourceSet with cdo URI on Eclipse Juno (4.2.1), on first
>> call to XtextResourceSet.getResource("cdo://repo1/Test/test.ecore",
>> true) it returns a CDOResource with a id equals to oid1 (temporary CDOID
>> to indicate that it is a CDOResource not yet commited to the server), in
>> the XtextResourceSet.getResource(URI,boolean) the code does not update
>> the uriResourceMap like does ResourceSetImpl.getResource(URI,boolean) at
>> the end. Consequently at the second call to
>> XtextResourceSet.getResource("cdo://repo1/Test/test.ecore", true) the
>> previously created CDOResource is not retreived from the uriResourceMap
>> then a new CDOResource is created for the same URI. Then on
>> CDOResource.save() (i.e. CDOTransaction.commit()) many exception occurs
>> because CDO complains about 2 CDOResources with the same URI. It seems a
>> bug in XtextResourceSet which does not update uriResourceMap. What do
>> you think about that?
>>
>> Best Regards
>
> I see also that in case of ResourceSetImpl the uriResourceMap by default
> is not initialized, equals to null, while in XtextResource it is
> initialized with a empty map in constructor.