Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [CDO] Transactional Editing Domain
[CDO] Transactional Editing Domain [message #116330] Fri, 28 March 2008 19:46 Go to next message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello!

I recently have read in a post that CDO does not work with GMF and
therefore not with EMF transactions!
But I have the following scenario: I have a GMF editor and some model
editor. For the model editing I am using CDO. I have references between
the model entities in the GMF editor and in the model editor. So I have to
use only one Editing Domain for both editors.
I tried it, but when adding some data to a resource a get an exception "a
resource set can only be modified within a write transaction".

What do you think Eike?! Is my problem able?!? Because I dont think that
proxies work between two EditingDomains and ResourceSets. Maybe this
question goes also to the EMF experts!


Best regards,
Matthias
Re: [CDO] Transactional Editing Domain [message #116340 is a reply to message #116330] Sat, 29 March 2008 14:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stepper.sympedia.de

Hi Matthias,

Comments inline...



Matthias schrieb:
> Hello!
>
> I recently have read in a post that CDO does not work with GMF and
> therefore not with EMF transactions!
Basically I think it's just the other way round: It seems odd to have
two transactional layers on top of each other. That's the reason why EMF
Transaction has been reported not to work well on top of CDO (haven't
verified that but think that sounds reasonable). If GMF editors are
tightly coupled to EMF Transaction it follows that it also has a problem
to work with CDO.

Unfortunately I didn't have the time so far to really test/proof/fix all
these hypothesises. I'd really appreciate to work together with you to
find a solution if possible. Is your code confidential or could I have a
look at it and play with it?

> But I have the following scenario: I have a GMF editor and some model
> editor. For the model editing I am using CDO. I have references
> between the model entities in the GMF editor and in the model editor.
> So I have to use only one Editing Domain for both editors. I tried it,
> but when adding some data to a resource a get an exception "a resource
> set can only be modified within a write transaction".
>
> What do you think Eike?! Is my problem able?!? Because I dont think
> that proxies work between two EditingDomains and ResourceSets. Maybe
> this question goes also to the EMF experts!
Apart from my conceptual concerns with stacked transaction solutions it
should be basically possible to attach a CDO transaction to existing
ResourceSets. Although it has not been tested so far you could try the
following:

ResourceSet resourceSet = ...
CDOSession session = ...
CDOTransaction transaction = session.openTransaction(resourceSet);
...
transaction.commit();
session.close();

Do you plan to have both the model and the diagram be managed by CDO?
If not, there could be another issue with referencing CDO objects from
"outside" (here: the diagram).
The reason is that a CDO URI does not contain information about the
repository that the object lives in.
This information is externally contributed through the CDOSession that
is associated with the local ResourceSet.
GMF diagrams are again a good candidate to see if this is convenient or
can be made better.

Cheers
/Eike



>
>
> Best regards,
> Matthias
>
Re: [CDO] Transactional Editing Domain [message #116499 is a reply to message #116340] Tue, 01 April 2008 10:50 Go to previous messageGo to next message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello Eike!

I am planning to use CDO for my whole domain model. So the best case would
be if CDO can also handle the GMF related models (Notation model, etc. ->
which are in fact legacy objects in CDO). So I am also looking forward
that CDO can also work with GMF, even with my help!

So currently I have to use Teneo in "combination" with CDO. I am using
Teneo for persisting the GMF diagram model and the mapped domain model
entities (not the whole domain model, only the entities that are defined
in the gmfmap model).

But there is another issue: I tried it, but I think it is not possible to
have (containment) proxy references between a Teneo Resource and a CDO
Resource. Say I have a "Container" inside a CDO Resource and a "Child"
object which reside in the HibernateXMLResouce (Teneo)! Otherwise I have
to store and manage two different objects with the same semantic data.

This would solve my problem! Or do we have any help from the the Teneo
"integration" in CDO?!

So summed up, yes I would like to use CDO for all the editing, but for now
I think it is not possible!

Best regards,
Matthias
Re: [CDO] Transactional Editing Domain [message #116591 is a reply to message #116499] Thu, 03 April 2008 08:10 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6580
Registered: July 2009
Senior Member
Hi Matthias,

Comments inline...



Matthias wrote:

> Hello Eike!

> I am planning to use CDO for my whole domain model. So the best case would
> be if CDO can also handle the GMF related models (Notation model, etc. ->
> which are in fact legacy objects in CDO). So I am also looking forward
> that CDO can also work with GMF, even with my help!
I'll have time during the weekend to think about how we can start on this
subject.

> So currently I have to use Teneo in "combination" with CDO. I am using
> Teneo for persisting the GMF diagram model and the mapped domain model
> entities (not the whole domain model, only the entities that are defined
> in the gmfmap model).

> But there is another issue: I tried it, but I think it is not possible to
> have (containment) proxy references between a Teneo Resource and a CDO
> Resource. Say I have a "Container" inside a CDO Resource and a "Child"
> object which reside in the HibernateXMLResouce (Teneo)! Otherwise I have
> to store and manage two different objects with the same semantic data.
I have not thought about containment proxies in the context of CDO so far.
I'm not sure if I want to make CDO capable of handling contanment proxies
that refer to instances outside of the repository of the containing
instance. CDO does even not handle this case for ordinary cross
references. because a CDO repository is considered to be self contained.
Usually I suggest to represent such references by some other means, e.g.
some sort of scalar foreign key and a derived feature that calculates the
target reference from the foreign key (possibly plus some application
context information). Would that be suitable for your case?

> This would solve my problem! Or do we have any help from the the Teneo
> "integration" in CDO?!
As I understand it, no. The issue you describe is an EMF issue (or better:
a CDO issue with respect to EMF). The new Hibernate integration happens
only on the CDO server where there is no EMF.

> So summed up, yes I would like to use CDO for all the editing, but for now
> I think it is not possible!
I guesss no, not at the moment, but it will be cool to work together to
get at that state ;-)

Cheers
/Eike



> Best regards,
> Matthias


Re: [CDO] Transactional Editing Domain [message #117419 is a reply to message #116591] Wed, 09 April 2008 07:18 Go to previous message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello Eike!

Thanks for your time investigations in my problems!

Yes it is not possible to "connect" a CDO model entity with a Teneo model
entity. That is the problem I have and I think there is no real solution
avaialable just for now.

Your "foreign key" approach sounds very interesting. I will take anything
if it works ;)!

The problem is my customer wants to see some effects, and so I have to use
Teneo "only" for my whole application.

I really would like to use CDO because you get so much for free (Client
update notifications, Revision manager, etc...) ...

Best regards,
Matthias
Re: [CDO] Transactional Editing Domain [message #616032 is a reply to message #116330] Sat, 29 March 2008 14:35 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6580
Registered: July 2009
Senior Member
Hi Matthias,

Comments inline...



Matthias schrieb:
> Hello!
>
> I recently have read in a post that CDO does not work with GMF and
> therefore not with EMF transactions!
Basically I think it's just the other way round: It seems odd to have
two transactional layers on top of each other. That's the reason why EMF
Transaction has been reported not to work well on top of CDO (haven't
verified that but think that sounds reasonable). If GMF editors are
tightly coupled to EMF Transaction it follows that it also has a problem
to work with CDO.

Unfortunately I didn't have the time so far to really test/proof/fix all
these hypothesises. I'd really appreciate to work together with you to
find a solution if possible. Is your code confidential or could I have a
look at it and play with it?

> But I have the following scenario: I have a GMF editor and some model
> editor. For the model editing I am using CDO. I have references
> between the model entities in the GMF editor and in the model editor.
> So I have to use only one Editing Domain for both editors. I tried it,
> but when adding some data to a resource a get an exception "a resource
> set can only be modified within a write transaction".
>
> What do you think Eike?! Is my problem able?!? Because I dont think
> that proxies work between two EditingDomains and ResourceSets. Maybe
> this question goes also to the EMF experts!
Apart from my conceptual concerns with stacked transaction solutions it
should be basically possible to attach a CDO transaction to existing
ResourceSets. Although it has not been tested so far you could try the
following:

ResourceSet resourceSet = ...
CDOSession session = ...
CDOTransaction transaction = session.openTransaction(resourceSet);
...
transaction.commit();
session.close();

Do you plan to have both the model and the diagram be managed by CDO?
If not, there could be another issue with referencing CDO objects from
"outside" (here: the diagram).
The reason is that a CDO URI does not contain information about the
repository that the object lives in.
This information is externally contributed through the CDOSession that
is associated with the local ResourceSet.
GMF diagrams are again a good candidate to see if this is convenient or
can be made better.

Cheers
/Eike



>
>
> Best regards,
> Matthias
>


Re: [CDO] Transactional Editing Domain [message #616048 is a reply to message #116340] Tue, 01 April 2008 10:50 Go to previous message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello Eike!

I am planning to use CDO for my whole domain model. So the best case would
be if CDO can also handle the GMF related models (Notation model, etc. ->
which are in fact legacy objects in CDO). So I am also looking forward
that CDO can also work with GMF, even with my help!

So currently I have to use Teneo in "combination" with CDO. I am using
Teneo for persisting the GMF diagram model and the mapped domain model
entities (not the whole domain model, only the entities that are defined
in the gmfmap model).

But there is another issue: I tried it, but I think it is not possible to
have (containment) proxy references between a Teneo Resource and a CDO
Resource. Say I have a "Container" inside a CDO Resource and a "Child"
object which reside in the HibernateXMLResouce (Teneo)! Otherwise I have
to store and manage two different objects with the same semantic data.

This would solve my problem! Or do we have any help from the the Teneo
"integration" in CDO?!

So summed up, yes I would like to use CDO for all the editing, but for now
I think it is not possible!

Best regards,
Matthias
Re: [CDO] Transactional Editing Domain [message #616059 is a reply to message #116499] Thu, 03 April 2008 08:10 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6580
Registered: July 2009
Senior Member
Hi Matthias,

Comments inline...



Matthias wrote:

> Hello Eike!

> I am planning to use CDO for my whole domain model. So the best case would
> be if CDO can also handle the GMF related models (Notation model, etc. ->
> which are in fact legacy objects in CDO). So I am also looking forward
> that CDO can also work with GMF, even with my help!
I'll have time during the weekend to think about how we can start on this
subject.

> So currently I have to use Teneo in "combination" with CDO. I am using
> Teneo for persisting the GMF diagram model and the mapped domain model
> entities (not the whole domain model, only the entities that are defined
> in the gmfmap model).

> But there is another issue: I tried it, but I think it is not possible to
> have (containment) proxy references between a Teneo Resource and a CDO
> Resource. Say I have a "Container" inside a CDO Resource and a "Child"
> object which reside in the HibernateXMLResouce (Teneo)! Otherwise I have
> to store and manage two different objects with the same semantic data.
I have not thought about containment proxies in the context of CDO so far.
I'm not sure if I want to make CDO capable of handling contanment proxies
that refer to instances outside of the repository of the containing
instance. CDO does even not handle this case for ordinary cross
references. because a CDO repository is considered to be self contained.
Usually I suggest to represent such references by some other means, e.g.
some sort of scalar foreign key and a derived feature that calculates the
target reference from the foreign key (possibly plus some application
context information). Would that be suitable for your case?

> This would solve my problem! Or do we have any help from the the Teneo
> "integration" in CDO?!
As I understand it, no. The issue you describe is an EMF issue (or better:
a CDO issue with respect to EMF). The new Hibernate integration happens
only on the CDO server where there is no EMF.

> So summed up, yes I would like to use CDO for all the editing, but for now
> I think it is not possible!
I guesss no, not at the moment, but it will be cool to work together to
get at that state ;-)

Cheers
/Eike



> Best regards,
> Matthias


Re: [CDO] Transactional Editing Domain [message #616135 is a reply to message #116591] Wed, 09 April 2008 07:18 Go to previous message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello Eike!

Thanks for your time investigations in my problems!

Yes it is not possible to "connect" a CDO model entity with a Teneo model
entity. That is the problem I have and I think there is no real solution
avaialable just for now.

Your "foreign key" approach sounds very interesting. I will take anything
if it works ;)!

The problem is my customer wants to see some effects, and so I have to use
Teneo "only" for my whole application.

I really would like to use CDO because you get so much for free (Client
update notifications, Revision manager, etc...) ...

Best regards,
Matthias
Previous Topic:Multi-database Teneo
Next Topic:[CDO] 0.8 Multiplr Inheritence Wrong featureID
Goto Forum:
  


Current Time: Fri Jun 25 11:21:21 GMT 2021

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

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

Back to the top