[CDO] Connection aware URIs [message #637142] |
Thu, 04 November 2010 10:59 |
|
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 11:50 |
|
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 !
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] Connection aware URIs [message #637152 is a reply to message #637151] |
Thu, 04 November 2010 11:52 |
|
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 !
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Re: [CDO] Connection aware URIs [message #637227 is a reply to message #637169] |
Thu, 04 November 2010 16:30 |
|
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 11:02 |
|
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
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04510 seconds