Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » reloading ecore
reloading ecore [message #539825] Sun, 13 June 2010 18:53 Go to next message
Harald Finster is currently offline Harald FinsterFriend
Messages: 37
Registered: July 2009
Member
Hello,

sorry for bothering you again with a beginners question.

I managed to create a simple meta-model (say "sample.ecore")
with the ecore editor (Sample Ecore Model Editor) and to create
resources based on it.
CDO-Session -> Register Workspace Packages...
CDO-Transaction -> create resource
....

Now I would like to modify the meta-model and start with a
"clean" database. Of course, I can drop all tables, restart the
server and reconnect the client, but I assume there is a better
way?

An other question: "the Getting started with CDO Galileo"
introduction mentions, that I have to create a .genmodel and
migrate it to CDO, but the "Register Workspace"
dialog seems to expect ".ecore" not ".genmodel".
So, what is the role of the ".genmodel" file?

Thanks for your patience!

Greetings Harald
Re: reloading ecore [message #539844 is a reply to message #539825] Mon, 14 June 2010 04:57 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Harald,

I only found your question by accident. Please prefix the subject of
CDO-related questions with [CDO].

Comments below...



Am 13.06.2010 20:53, schrieb Harald Finster:
> Hello,
>
> sorry for bothering you again with a beginners question.
>
What version of CDO are you using?

> I managed to create a simple meta-model (say "sample.ecore")
> with the ecore editor (Sample Ecore Model Editor) and to create
> resources based on it.
> CDO-Session -> Register Workspace Packages...
>
Then you're using a *dynamic* version of your model which is loaded from
the .ecore file in your workspace.

> CDO-Transaction -> create resource
> ....
>
> Now I would like to modify the meta-model and start with a
> "clean" database. Of course, I can drop all tables, restart the
> server and reconnect the client, but I assume there is a better
> way?
>
A better way to do what? Cleaning the database is not possible while
clients are connected or the server is running.

Or do you want to keep your existing data?

> An other question: "the Getting started with CDO Galileo"
> introduction mentions, that I have to create a .genmodel and
> migrate it to CDO,
Well, only if you want to use a *generated* version of your model and
not, like above, a dynamic version.

> but the "Register Workspace"
> dialog seems to expect ".ecore" not ".genmodel".
>
Yes, from a workspace or file system you can only import dynamic models.

> So, what is the role of the ".genmodel" file?
>
With a Genmodel you define the generation of Java code for your model.
This generated model (plugin) has to be deployed to your application and
is then available to all CDO 3.0 (!) sessions automatically. For CDO 2.0
it might be necessary to register it with a session in the CDOSessions
view via "Register Generated Package" or so.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


> Thanks for your patience!
>
> Greetings Harald
>


Re: reloading ecore [message #540045 is a reply to message #539844] Mon, 14 June 2010 16:30 Go to previous messageGo to next message
Harald Finster is currently offline Harald FinsterFriend
Messages: 37
Registered: July 2009
Member
Hi Eike,

Eike Stepper wrote:
> Hi Harald,
>
> I only found your question by accident. Please prefix the subject of
> CDO-related questions with [CDO].
>

okay, thanks for the hint

>>
> What version of CDO are you using?
>

I am working with 2.0.0.v200906221520

>> Now I would like to modify the meta-model and start with a
>> "clean" database. Of course, I can drop all tables, restart the
>> server and reconnect the client, but I assume there is a better
>> way?
>>
> A better way to do what? Cleaning the database is not possible while
> clients are connected or the server is running.
>
> Or do you want to keep your existing data?
>

no, at least not at the moment. (I imagine, that it must be a tough
job to restructure a database while keeping the data.)
At the moment, I would be happy with a relatively simple
mechanism which allows modifications of the model and to create a few
new resources based on the model.

My first (probably naive) attempts resulted in strange timeout exceptions:
I created an ecore model, registered it, modified it, registered
it again and so on. So, I assume, that I had several models
in parallel with clushes and/or inconsistencies.
After a "cleanup" of my database everything worked as expected.
And - again - I find it quite amazing what you and your coworkers
have done! An outstanding concept!

>> An other question: "the Getting started with CDO Galileo"
>> introduction mentions, that I have to create a .genmodel and
>> migrate it to CDO,
> Well, only if you want to use a *generated* version of your model and
> not, like above, a dynamic version.
>
>> but the "Register Workspace"
>> dialog seems to expect ".ecore" not ".genmodel".
>>
> Yes, from a workspace or file system you can only import dynamic models.
>
>> So, what is the role of the ".genmodel" file?
>>
> With a Genmodel you define the generation of Java code for your model.
> This generated model (plugin) has to be deployed to your application and
> is then available to all CDO 3.0 (!) sessions automatically. For CDO 2.0
> it might be necessary to register it with a session in the CDOSessions
> view via "Register Generated Package" or so.
>

okay, that's a clear description of the concept! Thanks!

Kind regards

Harald
Re: reloading ecore [message #540070 is a reply to message #540045] Mon, 14 June 2010 18:25 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 14.06.2010 18:30, schrieb Harald Finster:
>
> I am working with 2.0.0.v200906221520
>
Good that 3.0 GA is almost there :P

>
>>> Now I would like to modify the meta-model and start with a
>>> "clean" database. Of course, I can drop all tables, restart the
>>> server and reconnect the client, but I assume there is a better
>>> way?
>>>
>>>
>> A better way to do what? Cleaning the database is not possible while
>> clients are connected or the server is running.
>>
>> Or do you want to keep your existing data?
>>
>>
> no, at least not at the moment. (I imagine, that it must be a tough
> job to restructure a database while keeping the data.)
>
Yes. Model evolution support is on the plan after 3.0.

> At the moment, I would be happy with a relatively simple
> mechanism which allows modifications of the model and to create a few
> new resources based on the model.
>
It's best to

1) export all resources to XML
2) migrate them by hand to the new schema
3) stop the server and drop the database
4) start a new server
5) import the XML files into the new repo

If you don't need the old data skip steps 1, 2 and 5.

> My first (probably naive) attempts resulted in strange timeout exceptions:
>
Stack traces definitely help me to analyze the issue.

> I created an ecore model, registered it, modified it, registered
> it again and so on. So, I assume, that I had several models
> in parallel with clushes and/or inconsistencies.
>
Registering a modified Ecore model with the same nsURI in the same
repository is sabotage by intention!

> After a "cleanup" of my database everything worked as expected.
> And - again - I find it quite amazing what you and your coworkers
> have done! An outstanding concept!
>
Thank you ;-)

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: reloading ecore [message #540071 is a reply to message #540070] Mon, 14 June 2010 18:59 Go to previous messageGo to next message
Harald Finster is currently offline Harald FinsterFriend
Messages: 37
Registered: July 2009
Member
Hi Eike,


Eike Stepper wrote:
> Am 14.06.2010 18:30, schrieb Harald Finster:
>>
>> I am working with 2.0.0.v200906221520
>>
> Good that 3.0 GA is almost there :P

I just read the release plan. "Late June" sound great ;-)

>> no, at least not at the moment. (I imagine, that it must be a tough
>> job to restructure a database while keeping the data.)
>>
> Yes. Model evolution support is on the plan after 3.0.
>

my deepest respect, that you guys dare to tackle this task!

>> At the moment, I would be happy with a relatively simple
>> mechanism which allows modifications of the model and to create a few
>> new resources based on the model.
>>
> It's best to
>
> 1) export all resources to XML
> 2) migrate them by hand to the new schema
> 3) stop the server and drop the database
> 4) start a new server
> 5) import the XML files into the new repo
>
> If you don't need the old data skip steps 1, 2 and 5.
>

okay, that works fine for me at the moment

>> My first (probably naive) attempts resulted in strange timeout
>> exceptions:

> Registering a modified Ecore model with the same nsURI in the same
> repository is sabotage by intention!
>

yes, after having thought twice, I am aware that my doing was sabotage
:-( :-(
So, an exception would be "expected behaviour" in this case.
Do you want a stack trace anyways (if I can reproduce the "sabotage"? ;-)

BTW: I just managed to create a model of a tree-object, i.e.
an EClass with children and parent of the same EClass,
and it is just a pleasure to edit instances of it in the
generic editor ;-)

All the best

Harald
Re: reloading ecore [message #540075 is a reply to message #540071] Mon, 14 June 2010 19:03 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 14.06.2010 20:59, schrieb Harald Finster:
> Hi Eike,
>
>
> Eike Stepper wrote:
>
>> Am 14.06.2010 18:30, schrieb Harald Finster:
>>
>>> I am working with 2.0.0.v200906221520
>>>
>>>
>> Good that 3.0 GA is almost there :P
> I just read the release plan. "Late June" sound great ;-)
>
Actually the GA build is out since 10 minutes:
http://download.eclipse.org/modeling/emf/cdo/updates/3.0-rel eases/ ;-)

>> Registering a modified Ecore model with the same nsURI in the same
>> repository is sabotage by intention!
>>
>>
> yes, after having thought twice, I am aware that my doing was sabotage
> :-( :-(
> So, an exception would be "expected behaviour" in this case.
> Do you want a stack trace anyways (if I can reproduce the "sabotage"? ;-)
>
No :P

> BTW: I just managed to create a model of a tree-object, i.e.
> an EClass with children and parent of the same EClass,
> and it is just a pleasure to edit instances of it in the
> generic editor ;-)
>
Thank you. We hope to further enhance this experience after 3.0.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:[CDO] Exists an MWE Reader?
Next Topic:test Resource exists
Goto Forum:
  


Current Time: Sat Apr 20 01:22:14 GMT 2024

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

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

Back to the top