[CDO/XText int [message #989287] |
Wed, 05 December 2012 14:36 |
Eclipse User |
|
|
|
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
|
|
|
Re: [CDO/XText int [message #989300 is a reply to message #989287] |
Wed, 05 December 2012 14:57 |
Eclipse User |
|
|
|
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.
|
|
|
Re: [CDO/XText int [message #989348 is a reply to message #989300] |
Wed, 05 December 2012 18:35 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Am 05.12.12 15:57, schrieb Esteban DUGUEPEROUX:
> 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.
Please file a ticket against Xtext.
Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
|
|
|
Powered by
FUDForum. Page generated in 0.03834 seconds