Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [CDO/XText int
[CDO/XText int [message #989287] Wed, 05 December 2012 14:36 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
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
Previous Topic:Xtext/Xbase for writing complex math expressions
Next Topic:Strange behavior of JvmTypeReference assignments
Goto Forum:
  


Current Time: Thu Apr 25 07:12:14 GMT 2024

Powered by FUDForum. Page generated in 0.03020 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top