Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Illegal attempt to associate a collection with two open sessions
[Teneo] Illegal attempt to associate a collection with two open sessions [message #643590] Tue, 07 December 2010 14:23 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi,

In an attempt to have multiple root EObjects in an editor, I made two
URI towards Teneo each stored in a HibernateResource in the same
resourceset. When saving both resources, I get the following exception:
(Note: Objects from one resource, refer to objects from the other
resource).

SEVERE: Exception when saving resource netxstudio
org.hibernate.HibernateException: Illegal attempt to associate a
collection with two open sessions

So, clearly this is not the right approach, as two hibernate sessions
will be open and conflict when working on the same objects.

Could I somehow, augment a single resource with the content from two
queries in Teneo? Or alternatively should I omit resources altogether
and work with objects from queries with a single session? (The latter,
will not allow me to use i.e. EEF in my editor, which depends on resources.

thanks Christophe
Re: [Teneo] Illegal attempt to associate a collection with two open sessions [message #643653 is a reply to message #643590] Tue, 07 December 2010 18:18 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christophe,
There are multiple solutions:
- one resource can be loaded with multiple queries
- you can subclass the hibernateresource and implement your own loading logic
- multiple resources can share the same session

These options are described here:
http://wiki.eclipse.org/Teneo/Hibernate/EMF_Resource


gr. Martin


On 12/07/2010 03:23 PM, Christophe Bouhier wrote:
> Hi,
>
> In an attempt to have multiple root EObjects in an editor, I made two
> URI towards Teneo each stored in a HibernateResource in the same
> resourceset. When saving both resources, I get the following exception:
> (Note: Objects from one resource, refer to objects from the other
> resource).
>
> SEVERE: Exception when saving resource netxstudio
> org.hibernate.HibernateException: Illegal attempt to associate a
> collection with two open sessions
>
> So, clearly this is not the right approach, as two hibernate sessions
> will be open and conflict when working on the same objects.
>
> Could I somehow, augment a single resource with the content from two
> queries in Teneo? Or alternatively should I omit resources altogether
> and work with objects from queries with a single session? (The latter,
> will not allow me to use i.e. EEF in my editor, which depends on resources.
>
> thanks Christophe


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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] Illegal attempt to associate a collection with two open sessions [message #643773 is a reply to message #643653] Wed, 08 December 2010 08:58 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 07-12-10 19:18, Martin Taal wrote:
> Hi Christophe,
> There are multiple solutions:
> - one resource can be loaded with multiple queries
> - you can subclass the hibernateresource and implement your own loading
> logic
> - multiple resources can share the same session
>
> These options are described here:
> http://wiki.eclipse.org/Teneo/Hibernate/EMF_Resource
Thanks Martin!

>
>
> gr. Martin
>
>
> On 12/07/2010 03:23 PM, Christophe Bouhier wrote:
>> Hi,
>>
>> In an attempt to have multiple root EObjects in an editor, I made two
>> URI towards Teneo each stored in a HibernateResource in the same
>> resourceset. When saving both resources, I get the following exception:
>> (Note: Objects from one resource, refer to objects from the other
>> resource).
>>
>> SEVERE: Exception when saving resource netxstudio
>> org.hibernate.HibernateException: Illegal attempt to associate a
>> collection with two open sessions
>>
>> So, clearly this is not the right approach, as two hibernate sessions
>> will be open and conflict when working on the same objects.
>>
>> Could I somehow, augment a single resource with the content from two
>> queries in Teneo? Or alternatively should I omit resources altogether
>> and work with objects from queries with a single session? (The latter,
>> will not allow me to use i.e. EEF in my editor, which depends on
>> resources.
>>
>> thanks Christophe
>
>
Previous Topic:Anonymous Enumerations Always Get Default Value
Next Topic:How to deserialize XML to xml schema EMF model objects
Goto Forum:
  


Current Time: Fri Apr 26 06:42:17 GMT 2024

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

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

Back to the top