Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CDOResource obtaining the connection aware URI
[CDO] CDOResource obtaining the connection aware URI [message #1222039] Thu, 19 December 2013 09:51 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi,


I now obtain CDO resources using connection aware URI's and a
ViewProvider. This is really cool, as it abstracts away the CDO
plumbing, all is needed is the URI to work with CDO.

There are some aspects, I do not fully grasp yet.

1) I found out that a CDOResource obtained with a connection aware URI,
will store the URI as a canonical URI.

So a resource a obtained with:

cdo.net4j.tcp://localhost:2037/repo_source/a

when calling:

resource.getURI() will return cdo://repo_source/a

This is in away surprising, for example, how do I link it back to the
connection used to obtain the resource initally?

I just wonder what the underlying thought for this choice is ?


In my case the XYZViewProvider deals with both connection aware and
canonical URI's. However in the cannonical case the authority info is
missing (Host:port), so obtaining a TCPConnector is not possible with
only the canonical URI info.


2) Now I have a resource with an underlying CDOView/Transaction but how
do I close the underlying CDO stuff when disposing. I am thinking it
would be cool to have a CDOViewDisposer which could be registered as the
CDOViewProvider and act on resource.unload.

Any insights on this?


Thank You,
Christophe
Re: [CDO] CDOResource obtaining the connection aware URI [message #1222040 is a reply to message #1222039] Thu, 19 December 2013 10:12 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 5574
Registered: July 2009
Senior Member
Am 19.12.2013 10:51, schrieb Christophe Bouhier:
> Hi,
>
>
> I now obtain CDO resources using connection aware URI's and a ViewProvider. This is really cool, as it abstracts away
> the CDO plumbing, all is needed is the URI to work with CDO.
>
> There are some aspects, I do not fully grasp yet.
>
> 1) I found out that a CDOResource obtained with a connection aware URI, will store the URI as a canonical URI.
>
> So a resource a obtained with:
>
> cdo.net4j.tcp://localhost:2037/repo_source/a
>
> when calling:
>
> resource.getURI() will return cdo://repo_source/a
>
> This is in away surprising, for example, how do I link it back to the connection used to obtain the resource initally?
>
> I just wonder what the underlying thought for this choice is ?
>
>
> In my case the XYZViewProvider deals with both connection aware and canonical URI's. However in the cannonical case
> the authority info is missing (Host:port), so obtaining a TCPConnector is not possible with only the canonical URI info.
Can you give an example of what you need this initialURI for?

The initialURI is stored in a private field of the CDOResource. If your use case is convincing we can expose it through API.

>
>
> 2) Now I have a resource with an underlying CDOView/Transaction but how do I close the underlying CDO stuff when
> disposing.
Please read the thread "[CDO] Closing transactions created in view provider" that started 9 days ago ;-)

> I am thinking it would be cool to have a CDOViewDisposer which could be registered as the CDOViewProvider and act on
> resource.unload.
Why do you want to register it with the CDOViewProvider? I think it would be a ResourceSet adapter.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] CDOResource obtaining the connection aware URI [message #1222041 is a reply to message #1222040] Thu, 19 December 2013 10:26 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi Eike, swift as usual :-)
See inline response below.
Christophe

On 19-12-13 11:12, Eike Stepper wrote:
> Am 19.12.2013 10:51, schrieb Christophe Bouhier:
>> Hi,
>>
>>
>> I now obtain CDO resources using connection aware URI's and a
>> ViewProvider. This is really cool, as it abstracts away the CDO
>> plumbing, all is needed is the URI to work with CDO.
>>
>> There are some aspects, I do not fully grasp yet.
>>
>> 1) I found out that a CDOResource obtained with a connection aware
>> URI, will store the URI as a canonical URI.
>>
>> So a resource a obtained with:
>>
>> cdo.net4j.tcp://localhost:2037/repo_source/a
>>
>> when calling:
>>
>> resource.getURI() will return cdo://repo_source/a
>>
>> This is in away surprising, for example, how do I link it back to the
>> connection used to obtain the resource initally?
>>
>> I just wonder what the underlying thought for this choice is ?
>>
>>
>> In my case the XYZViewProvider deals with both connection aware and
>> canonical URI's. However in the cannonical case the authority info is
>> missing (Host:port), so obtaining a TCPConnector is not possible with
>> only the canonical URI info.
> Can you give an example of what you need this initialURI for?
>
> The initialURI is stored in a private field of the CDOResource. If your
> use case is convincing we can expose it through API.

I working on a test case for Edapt to 'evolve' a CDO resource. The
evolved resource is copied over to a 2nd CDO Repo. For this, I use conn.
URI's as I can specify the port, host etc...

The case first copies a regular XMI resource to CDO source. From this I
get a CDOResource, which I want to 'migrate' over, but I lose the conn.
URI along the way. This is no biggy, If I remember the initial conn.
URI, but it's a bit more effort.

>
>>
>>
>> 2) Now I have a resource with an underlying CDOView/Transaction but
>> how do I close the underlying CDO stuff when disposing.
> Please read the thread "[CDO] Closing transactions created in view
> provider" that started 9 days ago ;-)
>
Ah I missed this post...

>> I am thinking it would be cool to have a CDOViewDisposer which could
>> be registered as the CDOViewProvider and act on resource.unload.
> Why do you want to register it with the CDOViewProvider? I think it
> would be a ResourceSet adapter.
>
No, I want to register it 'as' or 'in similar fashion'. A resource set
adapter could do something similar I guess.

> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
Previous Topic:how to create a database connection and perform through emf_rcp
Next Topic:[EMF] [CDO] [Compare] [Bug?] Compare will not work with certan implementation of EStore
Goto Forum:
  


Current Time: Wed Nov 26 05:56:25 GMT 2014

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

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