Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO/Teneo/Hibernate] Select query very large ....
[CDO/Teneo/Hibernate] Select query very large .... [message #885661] Wed, 13 June 2012 12:11 Go to next message
ben ben is currently offline ben benFriend
Messages: 28
Registered: June 2012
Junior Member
Hi everyone,

I use a CDO server with a Teneo Hibernate mapping (auomatically generated, no JPA annotations). Below is my cdo-server.xml config (I use a SQLServer database).

It seems to be a problem with Select query which is very large. It seems that it use all atributes to select an element without using a PK. So the SQL request contains more than 87,000 chars !!!!(see request below).

The problem is that this query takes several minutes to be executed ...

Is there a way to avoid having all attributes defined in query ? manual mapping ?

Thanks !
  • Attachment: cdo-server.xml
    (Size: 3.23KB, Downloaded 123 times)
  • Attachment: sql.txt
    (Size: 85.55KB, Downloaded 134 times)
Re: [CDO/Teneo/Hibernate] Select query very large .... [message #885685 is a reply to message #885661] Wed, 13 June 2012 12:37 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ben,
Hmm it is quite difficult to influence this. I would try a different inheritance mapping strategy instead of
SINGLE_TABLE try JOINED.

gr. Martin

On 06/13/2012 02:11 PM, ben ben wrote:
> Hi everyone,
>
> I use a CDO server with a Teneo Hibernate mapping (auomatically generated, no JPA annotations). Below is my cdo-server.xml config (I use a SQLServer database).
>
> It seems to be a problem with Select query which is very large. It seems that it use all atributes to select an element without using a PK. So the SQL request contains more than 87,000 chars !!!!(see request below).
>
> The problem is that this query takes several minutes to be executed ...
>
> Is there a way to avoid having all attributes defined in query ? manual mapping ?
>
> Thanks !
>


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [CDO/Teneo/Hibernate] Select query very large .... [message #885722 is a reply to message #885661] Wed, 13 June 2012 13:35 Go to previous messageGo to next message
ben ben is currently offline ben benFriend
Messages: 28
Registered: June 2012
Junior Member
Thanks for your reply.

It's worse in JOINED mode, query is longer and fails with a resource leak in SQLServer ...

Maybe the problem comes from a one2many opposite relationship in my Ecore model.
Etude (type on which the select is about) contains a list of ETMBElement.
ETMBElement contains an Etude container reference which is opoosite of Etude->ETMBElement*.

Teneo can handle this properly ?
Re: [CDO/Teneo/Hibernate] Select query very large .... [message #885736 is a reply to message #885722] Wed, 13 June 2012 14:06 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ben,
Teneo has been around for many years and persists many types of models, most go well, some have trouble. I am afraid
that your model falls in the latter category.I have no idea why the query is soo large, I would need to study your model
in detail and also would need to know the save/update happening, but I am afraid that I don't have the time to do that.

Yes bi-directional many associations can be handled by Teneo.

gr. Martin

On 06/13/2012 03:35 PM, ben ben wrote:
> Thanks for your reply.
>
> It's worse in JOINED mode, query is longer and fails with a resource leak in SQLServer ...
>
> Maybe the problem comes from a one2many opposite relationship in my Ecore model.
> Etude (type on which the select is about) contains a list of ETMBElement.
> ETMBElement contains an Etude container reference which is opoosite of Etude->ETMBElement*.
>
> Teneo can handle this properly ?


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [CDO/Teneo/Hibernate] Select query very large .... [message #885754 is a reply to message #885736] Wed, 13 June 2012 14:32 Go to previous messageGo to next message
ben ben is currently offline ben benFriend
Messages: 28
Registered: June 2012
Junior Member
I tried to remove opossite relationship and the problem is still here.

This query is executed when I commit a new "ETMBElement".

In my model, there is a type "Etude" which contains a list of "ETMBElement" (containment = true).

Is it normal that CDO selects whole Etude when I commit only a new ETMBElement ?
Re: [CDO/Teneo/Hibernate] Select query very large .... [message #885781 is a reply to message #885754] Wed, 13 June 2012 15:25 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Yes maybe because of the containment thing, I am not 100% sure, I don't know your program code or model.

Can you post the model, or send it directly to me? I am very very busy, so I am not sure when I can take a look,
sometimes things go fast, and sometimes not...

gr. Martin

On 06/13/2012 04:32 PM, ben ben wrote:
> I tried to remove opossite relationship and the problem is still here.
>
> This query is executed when I commit a new "ETMBElement".
>
> In my model, there is a type "Etude" which contains a list of "ETMBElement" (containment = true).
>
> Is it normal that CDO selects whole Etude when I commit only a new ETMBElement ?


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:Extended Model needs class/type instance of the referenced Base Model
Next Topic:EMF Development Environment
Goto Forum:
  


Current Time: Mon Dec 09 18:23:21 GMT 2019

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

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

Back to the top