Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo-EMF] SessionController - Multiple resources
[Teneo-EMF] SessionController - Multiple resources [message #98135] Mon, 01 October 2007 15:33 Go to next message
Parvez is currently offline ParvezFriend
Messages: 181
Registered: July 2009
Senior Member
Hi,

I am just looking at session controller for multiple resources.
http://www.elver.org/hibernate/hibernateresources.html
I was thinking that if I have 2 resources and if I make modifications in
objects from both resources but if save is called on one resource then
it will save only that resource data but it looks that it saves everything.
Just wondering, is there some solution for this?

For example, here is sample hierarchy(containment) of classes/objects:

A0
|
---A1
|
--- A2
|
---A3

res1 created by using uri "from A0"
res2 created by using uri "from A2"

Now, if make modifications say in object A0 and A2, but just save on any
one of the resource, it saves whole data.
Just wondering, if it is expected behaviour or can I do something about it.

Any suggestions?

Thanks.
- Parvez
Re: [Teneo-EMF] SessionController - Multiple resources [message #98196 is a reply to message #98135] Mon, 01 October 2007 21:18 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Parvez,
It is expected behavior (at least for Hibernate). Currently the only way to prevent this is to set
different cascade annotations on the relation from A0 to A1 and A2. But this would then apply to all
cases (also when A0 and A1 and A2 are in the same resource).

There are maybe ways to prevent this by overriding Hibernate's default cascade behavior at runtime
but this is far from easy (afaics) and I probably won't have time to add this behavior in the
foreseeable future. But you can always enter a call for this ofcourse so that it at least is on the
wish list.

gr. Martin

PC wrote:
> Hi,
>
> I am just looking at session controller for multiple resources.
> http://www.elver.org/hibernate/hibernateresources.html
> I was thinking that if I have 2 resources and if I make modifications in
> objects from both resources but if save is called on one resource then
> it will save only that resource data but it looks that it saves everything.
> Just wondering, is there some solution for this?
>
> For example, here is sample hierarchy(containment) of classes/objects:
>
> A0
> |
> ---A1
> |
> --- A2
> |
> ---A3
>
> res1 created by using uri "from A0"
> res2 created by using uri "from A2"
>
> Now, if make modifications say in object A0 and A2, but just save on any
> one of the resource, it saves whole data.
> Just wondering, if it is expected behaviour or can I do something about it.
>
> Any suggestions?
>
> Thanks.
> - Parvez


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo-EMF] SessionController - Multiple resources [message #98899 is a reply to message #98196] Wed, 10 October 2007 14:31 Go to previous message
Parvez is currently offline ParvezFriend
Messages: 181
Registered: July 2009
Senior Member
Thanks for the info Martin.
I have added an enhancement request i.e.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205925

-Parvez

Martin Taal wrote:
> Hi Parvez,
> It is expected behavior (at least for Hibernate). Currently the only way
> to prevent this is to set different cascade annotations on the relation
> from A0 to A1 and A2. But this would then apply to all cases (also when
> A0 and A1 and A2 are in the same resource).
>
> There are maybe ways to prevent this by overriding Hibernate's default
> cascade behavior at runtime but this is far from easy (afaics) and I
> probably won't have time to add this behavior in the foreseeable future.
> But you can always enter a call for this ofcourse so that it at least is
> on the wish list.
>
> gr. Martin
>
> PC wrote:
>> Hi,
>>
>> I am just looking at session controller for multiple resources.
>> http://www.elver.org/hibernate/hibernateresources.html
>> I was thinking that if I have 2 resources and if I make modifications
>> in objects from both resources but if save is called on one resource
>> then it will save only that resource data but it looks that it saves
>> everything.
>> Just wondering, is there some solution for this?
>>
>> For example, here is sample hierarchy(containment) of classes/objects:
>>
>> A0
>> |
>> ---A1
>> |
>> --- A2
>> |
>> ---A3
>>
>> res1 created by using uri "from A0"
>> res2 created by using uri "from A2"
>>
>> Now, if make modifications say in object A0 and A2, but just save on
>> any one of the resource, it saves whole data.
>> Just wondering, if it is expected behaviour or can I do something
>> about it.
>>
>> Any suggestions?
>>
>> Thanks.
>> - Parvez
>
>
Re: [Teneo-EMF] SessionController - Multiple resources [message #609864 is a reply to message #98135] Mon, 01 October 2007 21:18 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Parvez,
It is expected behavior (at least for Hibernate). Currently the only way to prevent this is to set
different cascade annotations on the relation from A0 to A1 and A2. But this would then apply to all
cases (also when A0 and A1 and A2 are in the same resource).

There are maybe ways to prevent this by overriding Hibernate's default cascade behavior at runtime
but this is far from easy (afaics) and I probably won't have time to add this behavior in the
foreseeable future. But you can always enter a call for this ofcourse so that it at least is on the
wish list.

gr. Martin

PC wrote:
> Hi,
>
> I am just looking at session controller for multiple resources.
> http://www.elver.org/hibernate/hibernateresources.html
> I was thinking that if I have 2 resources and if I make modifications in
> objects from both resources but if save is called on one resource then
> it will save only that resource data but it looks that it saves everything.
> Just wondering, is there some solution for this?
>
> For example, here is sample hierarchy(containment) of classes/objects:
>
> A0
> |
> ---A1
> |
> --- A2
> |
> ---A3
>
> res1 created by using uri "from A0"
> res2 created by using uri "from A2"
>
> Now, if make modifications say in object A0 and A2, but just save on any
> one of the resource, it saves whole data.
> Just wondering, if it is expected behaviour or can I do something about it.
>
> Any suggestions?
>
> Thanks.
> - Parvez


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo-EMF] SessionController - Multiple resources [message #609965 is a reply to message #98196] Wed, 10 October 2007 14:31 Go to previous message
Parvez is currently offline ParvezFriend
Messages: 181
Registered: July 2009
Senior Member
Thanks for the info Martin.
I have added an enhancement request i.e.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205925

-Parvez

Martin Taal wrote:
> Hi Parvez,
> It is expected behavior (at least for Hibernate). Currently the only way
> to prevent this is to set different cascade annotations on the relation
> from A0 to A1 and A2. But this would then apply to all cases (also when
> A0 and A1 and A2 are in the same resource).
>
> There are maybe ways to prevent this by overriding Hibernate's default
> cascade behavior at runtime but this is far from easy (afaics) and I
> probably won't have time to add this behavior in the foreseeable future.
> But you can always enter a call for this ofcourse so that it at least is
> on the wish list.
>
> gr. Martin
>
> PC wrote:
>> Hi,
>>
>> I am just looking at session controller for multiple resources.
>> http://www.elver.org/hibernate/hibernateresources.html
>> I was thinking that if I have 2 resources and if I make modifications
>> in objects from both resources but if save is called on one resource
>> then it will save only that resource data but it looks that it saves
>> everything.
>> Just wondering, is there some solution for this?
>>
>> For example, here is sample hierarchy(containment) of classes/objects:
>>
>> A0
>> |
>> ---A1
>> |
>> --- A2
>> |
>> ---A3
>>
>> res1 created by using uri "from A0"
>> res2 created by using uri "from A2"
>>
>> Now, if make modifications say in object A0 and A2, but just save on
>> any one of the resource, it saves whole data.
>> Just wondering, if it is expected behaviour or can I do something
>> about it.
>>
>> Any suggestions?
>>
>> Thanks.
>> - Parvez
>
>
Previous Topic:[TENEO] NPE when trying to load an Ecore model containing EEnums
Next Topic:[Teneo] comparison byte[] with Byte[]
Goto Forum:
  


Current Time: Sat Apr 13 10:10:24 GMT 2024

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

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

Back to the top