Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] How to "flush" CDO Package registry ?(Get rid of outdated / incorrect packages in the registry)
[CDO] How to "flush" CDO Package registry ? [message #998592] Thu, 10 January 2013 10:10 Go to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 176
Registered: September 2011
Senior Member
Hi all,

I defined models and then generated CDO native packages.
Due to the fact that i struggled a bit to get these packages in CDO, I made several trials with different nsURI.

And I noticed that old, incorrect or deleted packages still appear in the CDO Package registry, which could lead to exceptions when there are different nsURI declared in the registry for a same package (old and new nsURI).

The only way I found to "flush" the old nsURI from the registry is to delete CDO content on server side (by removing the database directory content !).

Is there any better way ?

Regards,

Laurent
Re: [CDO] How to "flush" CDO Package registry ? [message #998615 is a reply to message #998592] Thu, 10 January 2013 10:54 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 5574
Registered: July 2009
Senior Member
Hi Laurent,

I'm confused by some of your terms, see below...


Am 10.01.2013 11:10, schrieb laurent Mising name:
> Hi all,
>
> I defined models and then generated CDO native packages.
> Due to the fact that i struggled a bit to get these packages in CDO,
What do you mean by "get these packages in CDO"?

> I made several trials with different nsURI.
No matter what exactly you're trying to achieve, you must always use the nsURI that's generated into your package
interface and your plugin.xml.

> And I noticed that old, incorrect or deleted packages
What are those concepts? I haven't heard of them, yet.

> still appear in the CDO Package registry, which could lead to exceptions when there are different nsURI declared in
> the registry for a same package (old and new nsURI).
No clue what old and new mean here. Maybe some concrete code would help me to understand.

> The only way I found to "flush" the old nsURI from the registry is to delete CDO content on server side (by removing
> the database directory content !).
Nothing in this sentence is clear to me: What is "flush"? What is "database directory content"?

> Is there any better way ?
Hard to tell :P

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] How to "flush" CDO Package registry ? [message #998629 is a reply to message #998615] Thu, 10 January 2013 11:29 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 176
Registered: September 2011
Senior Member
Hi Eike,

I'll try to better explain myself.
Using the CDO Sessions view from Eclipse, I open a new session connected to a so-called "repo1".
With a right-click on the opened session, I can open the package registry.

Now let's say that I defined an "application" model. I can generate the corresponding CDO native java code (application, application.impl, application.util packages) in my project source folder.
The corresponding nsURI is (by default) : http://application/1.0

Then I launch an eclipse application containing the generated plug-in and the necessary components to get the CDO Sessions view as well.

As I said before, I can connect to my repo1, open the package registry where I find my stuff (the package registered with its nsURI). And I can create a resource containing an application. No problem.

Now let's say I decide to change my nsURI to http://application
I generate my CDO native code all over again.
I also have to modify manually my plugin.xml which still have the previous nsURI...

I then launch my eclipse application again, connect to my repo1, open the package regitry and then... I find two entries for my application package. One with the former nsURI and another one with the modified nsURI.

When I try to open the editor on my previously created resource, I get an exception because my editor is still looking for the package corresponding to the first nsURI...

So the question is : how do I get rid (or "flush" Wink) this old reference (without deleting CDO database...).

Regards,

Laurent
Re: [CDO] How to "flush" CDO Package registry ? [message #998641 is a reply to message #998629] Thu, 10 January 2013 11:58 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 5574
Registered: July 2009
Senior Member
Am 10.01.2013 12:29, schrieb laurent Mising name:
> Hi Eike,
>
> I'll try to better explain myself.
> Using the CDO Sessions view from Eclipse, I open a new session connected to a so-called "repo1".
> With a right-click on the opened session, I can open the package registry.
>
> Now let's say that I defined an "application" model. I can generate the corresponding CDO native java code
> (application, application.impl, application.util packages) in my project source folder.
> The corresponding nsURI is (by default) : http://application/1.0
>
> Then I launch an eclipse application containing the generated plug-in and the necessary components to get the CDO
> Sessions view as well.
>
> As I said before, I can connect to my repo1, open the package registry where I find my stuff (the package registered
> with its nsURI). And I can create a resource containing an application. No problem.
>
> Now let's say I decide to change my nsURI to http://application
That's not allowed. By having committed the "old" package (with that specific nsURI) and some objects that rely on it
you've kind of "released" the package to the public (like API).

> I generate my CDO native code all over again.
> I also have to modify manually my plugin.xml which still have the previous nsURI...
That has recently been fixed in EMF 2.9.

> I then launch my eclipse application again, connect to my repo1, open the package regitry and then... I find two
> entries for my application package. One with the former nsURI and another one with the modified nsURI.
The one with the "old" nsURI is there because CDO always stores a copy of the dynamic model in the database. It's used
by the client if the original package is no longer available locally.

The (expected) effect is that you've got 2 packages with different nsURIs available.

>
> When I try to open the editor on my previously created resource, I get an exception because my editor is still looking
> for the package corresponding to the first nsURI...
I *think* that shouldn't happen. It's probably a rare problem because nobody really uses dynamic packages in production.
And in development you better start a new repository.

>
> So the question is : how do I get rid (or "flush" ;)) this old reference (without deleting CDO database...).
You can't.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:EMF and SOAP - how?
Next Topic:[GWT] org.eclipse.emf.common.util.InvocationTargetException
Goto Forum:
  


Current Time: Sun Nov 23 17:32:35 GMT 2014

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

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