Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Connection aware URIs
[CDO] Connection aware URIs [message #637142] Thu, 04 November 2010 06:59 Go to next message
Alex Lagarde is currently offline Alex Lagarde
Messages: 177
Registered: May 2010
Senior Member

Hy everyone,

I was wondering if there is any mechanism in CDO to persist repository locations ?

I explain myself : if I reference in a local xmi resource a CDOResource, the URI will be persisted : "cdo://repo1/myResource.xmi". There is no problem with that while I'm connected to the CDO Repository (repo1) containing the resource, as CDOURIHandlers will retrieve this Resource.

Let's now say that I have closed my connection and my local Resource. When I re-open this local Resource, CDOURIHandlers aren't able to retrieve the referenced CDOResource any more, as the connection to the repository has been closed.

Is there any mechanism that would allow me to connect automatically to the Repository location corresponding to its UUID ("repo1") ?

If not, do you think that creating my own URIHandler,capable of dealing with URI such as "cdo://repo1/myResource.xmi##tcp://localhost:2036" by connecting to the Repository if no connection is detected, is a good idea ?

Thanks !
Re: [CDO] Connection aware URIs [message #637151 is a reply to message #637142] Thu, 04 November 2010 07:50 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5503
Registered: July 2009
Senior Member
Am 04.11.2010 11:59, schrieb alagarde:
> Hy everyone,
> I was wondering if there is any mechanism in CDO to persist repository locations ?
> I explain myself : if I reference in a local xmi resource a CDOResource, the URI will be persisted : "cdo://repo1/myResource.xmi". There is no problem with that while I'm connected to the CDO Repository (repo1) containing the resource, as CDOURIHandlers will retrieve this Resource.
>
> Let's now say that I have closed my connection and my local Resource. When I re-open this local Resource, CDOURIHandlers aren't able to retrieve the referenced CDOResource any more, as the connection to the repository has been closed.
> Is there any mechanism that would allow me to connect automatically to the Repository location corresponding to its UUID ("repo1") ?
> If not, do you think that creating my own URIHandler,capable of dealing with URI such as "cdo://repo1/myResource.xmi##tcp://localhost:2036" by connecting to the Repository if no connection is detected, is a good idea ?
A very good idea (except for the hash signs in your example)! That's why I implemented it just the other week :P

Please have a look at:

291574: Provide connection-aware URI formats
https://bugs.eclipse.org/bugs/show_bug.cgi?id=291574

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Thanks !
Re: [CDO] Connection aware URIs [message #637152 is a reply to message #637151] Thu, 04 November 2010 07:52 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5503
Registered: July 2009
Senior Member
Correction, it is this bugzilla:

326186: Provide a URI format that contains connection information
https://bugs.eclipse.org/bugs/show_bug.cgi?id=326186

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 04.11.2010 12:50, schrieb Eike Stepper:
> Am 04.11.2010 11:59, schrieb alagarde:
>> Hy everyone,
>> I was wondering if there is any mechanism in CDO to persist repository locations ?
>> I explain myself : if I reference in a local xmi resource a CDOResource, the URI will be persisted : "cdo://repo1/myResource.xmi". There is no problem with that while I'm connected to the CDO Repository (repo1) containing the resource, as CDOURIHandlers will retrieve this Resource.
>>
>> Let's now say that I have closed my connection and my local Resource. When I re-open this local Resource, CDOURIHandlers aren't able to retrieve the referenced CDOResource any more, as the connection to the repository has been closed.
>> Is there any mechanism that would allow me to connect automatically to the Repository location corresponding to its UUID ("repo1") ?
>> If not, do you think that creating my own URIHandler,capable of dealing with URI such as "cdo://repo1/myResource.xmi##tcp://localhost:2036" by connecting to the Repository if no connection is detected, is a good idea ?
> A very good idea (except for the hash signs in your example)! That's why I implemented it just the other week :P
>
> Please have a look at:
>
> 291574: Provide connection-aware URI formats
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=291574
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> Thanks !
Re: [CDO] Connection aware URIs [message #637169 is a reply to message #637152] Thu, 04 November 2010 08:58 Go to previous messageGo to next message
Alex Lagarde is currently offline Alex Lagarde
Messages: 177
Registered: May 2010
Senior Member

Thanks a lot for you fast reply, as usual !

I'm going to use it right now.
Re: [CDO] Connection aware URIs [message #637227 is a reply to message #637169] Thu, 04 November 2010 12:30 Go to previous messageGo to next message
Alex Lagarde is currently offline Alex Lagarde
Messages: 177
Registered: May 2010
Senior Member

Hy again !

I have tested the Connection-aware URIs and they are perfect for my useCase.

However, I would like to activate these URIs by default, so that if I reference a CDOObject from a local Resource the href serialized is a connection-aware URI and not a standard CDO URI.

I don't know if I'm clear : I would like my xmi file to look like :

 <referencedElement xmi:type="cars:Garage" href="cdo.net4j.tcp://localhost/repo1/remoteSemanticResource.xmi?transactional=true#1"/>


and not

<referencedElement xmi:type="cars:Garage" href="cdo:t/repo1/remoteSemanticResource.xmi#1"


I've tried to use the code from ViewProviderTest for getting the CDOResource :

final URI resourceURI = new CDONet4jViewProvider.TCP().getResourceURI(transaction, remoteResourcePath);
ResourceSet resourceSet = new ResourceSetImpl();
 final CDOResource remoteResource = (CDOResource) resourceSet.getResource(resourceURI, true);


but when my local resource is saved I still have a simple CDO URI. I also tried to set ruffly the Connection-aware URI to my resource but this don't work either.

Am I missing something here ?


Re: [CDO] Connection aware URIs [message #637399 is a reply to message #637227] Fri, 05 November 2010 07:02 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5503
Registered: July 2009
Senior Member
Am 04.11.2010 17:30, schrieb alagarde:
> Hy again !
> I have tested the Connection-aware URIs and they are perfect for my useCase.
>
> However, I would like to activate these URIs by default, so that if I reference a CDOObject from a local Resource the href serialized is a connection-aware URI and not a standard CDO URI.
> I don't know if I'm clear : I would like my xmi file to look like :
>
> <referencedElement xmi:type="cars:Garage" href=" cdo.net4j.tcp://localhost/repo1/remoteSemanticResource.xmi?t ransactional=true#1"/>
>
>
> and not
>
> <referencedElement xmi:type="cars:Garage" href="cdo:t/repo1/remoteSemanticResource.xmi#1"
>
>
> I've tried to use the code from ViewProviderTest for getting the CDOResource :
>
> final URI resourceURI = new CDONet4jViewProvider.TCP().getResourceURI(transaction, remoteResourcePath);
> ResourceSet resourceSet = new ResourceSetImpl();
> final CDOResource remoteResource = (CDOResource) resourceSet.getResource(resourceURI, true);
>
>
> but when my local resource is saved I still have a simple CDO URI. I also tried to set ruffly the Connection-aware URI to my resource but this don't work either.
> Am I missing something here ?
Not necessarily. This feature has been developed with some very specific use cases in mind, and tested for these. It's well possible that this whole brand new feature does not yet fulfil any possible requirement. Can you please reopen the bugzilla and add a comment so that it reminds me to validate your use case?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Connection aware URIs [message #637935 is a reply to message #637399] Tue, 09 November 2010 07:07 Go to previous messageGo to next message
Alex Lagarde is currently offline Alex Lagarde
Messages: 177
Registered: May 2010
Senior Member

posted a comment on the bugzilla (https://bugs.eclipse.org/bugs/show_bug.cgi?id=326186) but cannot re-open the bug (only the bug creator can, am I right ?).
Re: [CDO] Connection aware URIs [message #637940 is a reply to message #637935] Tue, 09 November 2010 07:12 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5503
Registered: July 2009
Senior Member
Am 09.11.2010 13:07, schrieb alagarde:
> posted a comment on the bugzilla (https://bugs.eclipse.org/bugs/show_bug.cgi?id=326186) but cannot re-open the bug (only the bug creator can, am I right ?).
That's what we've also figured. Please just open a new one if you think it's adequate ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Connection aware URIs [message #637942 is a reply to message #637940] Tue, 09 November 2010 07:27 Go to previous messageGo to next message
Alex Lagarde is currently offline Alex Lagarde
Messages: 177
Registered: May 2010
Senior Member

Hy,

I don't think that created a new bug is the best idea, as my feature request is clearly in the bug scope.

Thanks again for your interest !
Re: [CDO] Connection aware URIs [message #637965 is a reply to message #637942] Tue, 09 November 2010 08:31 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5503
Registered: July 2009
Senior Member
Am 09.11.2010 13:27, schrieb alagarde:
> Hy,
>
> I don't think that created a new bug is the best idea, as my feature request is clearly in the bug scope.
>
> Thanks again for your interest !
The bugzilla that you can not reopen was to track the effort for a paying customer. Your requirements are not included in his requirements. Please open a new bugzilla.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Connection aware URIs [message #637973 is a reply to message #637965] Tue, 09 November 2010 09:03 Go to previous message
Alex Lagarde is currently offline Alex Lagarde
Messages: 177
Registered: May 2010
Senior Member

That's done : https://bugs.eclipse.org/bugs/show_bug.cgi?id=329786.

Thanks again, for now on I've made a nice work around to ensure proper reconnection.

As I said in the bugzilla, it would be great to have enough extensibility to control how the reconnection processes (how to create the session/the transaction ? When closing it ?).
Previous Topic:Configuration for Tables
Next Topic:Ecore Model
Goto Forum:
  


Current Time: Sat Aug 30 00:31:20 EDT 2014

Powered by FUDForum. Page generated in 0.02288 seconds