Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo: getChoiceOfValues(Object object) very long...
Teneo: getChoiceOfValues(Object object) very long... [message #79049] Tue, 10 April 2007 09:37 Go to next message
Eclipse UserFriend
Originally posted by: mat.loo.gmail.com

Hi,

The method
public Collection getChoiceOfValues(Object object)
from
org.eclipse.emf.edit.provider.IItemPropertyDescriptor

can be very long while using EMF/Teneo because it seems a lot of requests
are sent by Hibernate.
Is there a basic way to avoid such a time consuming ?

Furthermore, it seems, these calls are made even if the data have not
changed between 2 calls.
Do you see something to avoid this too ?

Thx.
Re: Teneo: getChoiceOfValues(Object object) very long... [message #79065 is a reply to message #79049] Tue, 10 April 2007 09:45 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mat,
What does the method do in your case?
Is the method called for an ereference which refers to an type which has many instances in the db?

gr. Martin

Mat Lo wrote:
> Hi,
>
> The method
> public Collection getChoiceOfValues(Object object)
> from org.eclipse.emf.edit.provider.IItemPropertyDescriptor
>
> can be very long while using EMF/Teneo because it seems a lot of
> requests are sent by Hibernate.
> Is there a basic way to avoid such a time consuming ?
>
> Furthermore, it seems, these calls are made even if the data have not
> changed between 2 calls.
> Do you see something to avoid this too ?
>
> Thx.
>


--

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: getChoiceOfValues(Object object) very long... [message #79076 is a reply to message #79065] Tue, 10 April 2007 09:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mat.loo.gmail.com

Hi,

Yes, my method is time consuming when calling it for a EReference that has
many objects.
So it seems very logical that it is time consuming !
Besides, in my context, this method can be called "recursively" since it
can be used in a "Copy objects" context. That is I want to copy the target
object and children of children... These children are not necesseraly
"econtainment" of other objects, the parent-to-child link is
functionnal-oriented and not container-to-containment oriented in my
context.

BUT.
I hoped it would not take so much time...
I guess I'm doing something wrong because I spend a lot of time in this
method...

There is no parametrization I should use ?

Thx
Re: Teneo: getChoiceOfValues(Object object) very long... [message #79091 is a reply to message #79076] Tue, 10 April 2007 10:07 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mat,
No there is no parametrization. Often paging is used to support the visualization of a choice from a
list of many objects. I would also advice to use the newest release of teneo as this one supports
hibernate proxies which makes it possible that also many-to-ones are loaded lazily.
Please check the hibernate manual for more information on hibernate proxying (and the elver.org
website).

gr. Martin

Mat Lo wrote:
> Hi,
>
> Yes, my method is time consuming when calling it for a EReference that
> has many objects.
> So it seems very logical that it is time consuming !
> Besides, in my context, this method can be called "recursively" since it
> can be used in a "Copy objects" context. That is I want to copy the
> target object and children of children... These children are not
> necesseraly "econtainment" of other objects, the parent-to-child link is
> functionnal-oriented and not container-to-containment oriented in my
> context.
>
> BUT.
> I hoped it would not take so much time...
> I guess I'm doing something wrong because I spend a lot of time in this
> method...
>
> There is no parametrization I should use ?
>
> Thx
>


--

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: getChoiceOfValues(Object object) very long... [message #79104 is a reply to message #79076] Tue, 10 April 2007 11:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Mat,

If possible, you could consider specializing the property descriptor's
getChoiceOfValues methods to not search the entire set of all reachable
objects which is what it's currently doing in order to find all the
objects that are instances of the particular EReference's EClass. I
suppose you could also look into caching the result of either the whole
set, or of just the ones that match a particular EClass, but then you'd
get into issues of when to clear the cache (perhaps after a command is
executed).


Mat Lo wrote:
> Hi,
>
> Yes, my method is time consuming when calling it for a EReference that
> has many objects.
> So it seems very logical that it is time consuming !
> Besides, in my context, this method can be called "recursively" since
> it can be used in a "Copy objects" context. That is I want to copy the
> target object and children of children... These children are not
> necesseraly "econtainment" of other objects, the parent-to-child link
> is functionnal-oriented and not container-to-containment oriented in
> my context.
>
> BUT.
> I hoped it would not take so much time...
> I guess I'm doing something wrong because I spend a lot of time in
> this method...
>
> There is no parametrization I should use ?
>
> Thx
>
Re: Teneo: getChoiceOfValues(Object object) very long... [message #79134 is a reply to message #79104] Tue, 10 April 2007 13:30 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Mat,
Refering to the post of Ed, you can use a hql query to only retrieve the objects of a specific type.

gr. Martin

Ed Merks wrote:
> Mat,
>
> If possible, you could consider specializing the property descriptor's
> getChoiceOfValues methods to not search the entire set of all reachable
> objects which is what it's currently doing in order to find all the
> objects that are instances of the particular EReference's EClass. I
> suppose you could also look into caching the result of either the whole
> set, or of just the ones that match a particular EClass, but then you'd
> get into issues of when to clear the cache (perhaps after a command is
> executed).
>
>
> Mat Lo wrote:
>> Hi,
>>
>> Yes, my method is time consuming when calling it for a EReference that
>> has many objects.
>> So it seems very logical that it is time consuming !
>> Besides, in my context, this method can be called "recursively" since
>> it can be used in a "Copy objects" context. That is I want to copy the
>> target object and children of children... These children are not
>> necesseraly "econtainment" of other objects, the parent-to-child link
>> is functionnal-oriented and not container-to-containment oriented in
>> my context.
>>
>> BUT.
>> I hoped it would not take so much time...
>> I guess I'm doing something wrong because I spend a lot of time in
>> this method...
>>
>> There is no parametrization I should use ?
>>
>> Thx
>>


--

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: getChoiceOfValues(Object object) very long... [message #79149 is a reply to message #79104] Tue, 10 April 2007 13:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mat.loo.gmail.com

Thx Ed.

Martin, is Teneo able to manage such a cache Ed is talking about ?
Re: Teneo: getChoiceOfValues(Object object) very long... [message #79196 is a reply to message #79149] Tue, 10 April 2007 13:57 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mat,
See my post after Ed. You can use a hql query to just query for a specific eclass. Hibernate
supports session caching as well as level 2 caching (between sessions).

gr. Martin

Mat Lo wrote:
> Thx Ed.
>
> Martin, is Teneo able to manage such a cache Ed is talking about ?
>


--

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: getChoiceOfValues(Object object) very long... [message #604529 is a reply to message #79049] Tue, 10 April 2007 09:45 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mat,
What does the method do in your case?
Is the method called for an ereference which refers to an type which has many instances in the db?

gr. Martin

Mat Lo wrote:
> Hi,
>
> The method
> public Collection getChoiceOfValues(Object object)
> from org.eclipse.emf.edit.provider.IItemPropertyDescriptor
>
> can be very long while using EMF/Teneo because it seems a lot of
> requests are sent by Hibernate.
> Is there a basic way to avoid such a time consuming ?
>
> Furthermore, it seems, these calls are made even if the data have not
> changed between 2 calls.
> Do you see something to avoid this too ?
>
> Thx.
>


--

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: getChoiceOfValues(Object object) very long... [message #604535 is a reply to message #79065] Tue, 10 April 2007 09:57 Go to previous message
Eclipse UserFriend
Originally posted by: mat.loo.gmail.com

Hi,

Yes, my method is time consuming when calling it for a EReference that has
many objects.
So it seems very logical that it is time consuming !
Besides, in my context, this method can be called "recursively" since it
can be used in a "Copy objects" context. That is I want to copy the target
object and children of children... These children are not necesseraly
"econtainment" of other objects, the parent-to-child link is
functionnal-oriented and not container-to-containment oriented in my
context.

BUT.
I hoped it would not take so much time...
I guess I'm doing something wrong because I spend a lot of time in this
method...

There is no parametrization I should use ?

Thx
Re: Teneo: getChoiceOfValues(Object object) very long... [message #604536 is a reply to message #79076] Tue, 10 April 2007 10:07 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mat,
No there is no parametrization. Often paging is used to support the visualization of a choice from a
list of many objects. I would also advice to use the newest release of teneo as this one supports
hibernate proxies which makes it possible that also many-to-ones are loaded lazily.
Please check the hibernate manual for more information on hibernate proxying (and the elver.org
website).

gr. Martin

Mat Lo wrote:
> Hi,
>
> Yes, my method is time consuming when calling it for a EReference that
> has many objects.
> So it seems very logical that it is time consuming !
> Besides, in my context, this method can be called "recursively" since it
> can be used in a "Copy objects" context. That is I want to copy the
> target object and children of children... These children are not
> necesseraly "econtainment" of other objects, the parent-to-child link is
> functionnal-oriented and not container-to-containment oriented in my
> context.
>
> BUT.
> I hoped it would not take so much time...
> I guess I'm doing something wrong because I spend a lot of time in this
> method...
>
> There is no parametrization I should use ?
>
> Thx
>


--

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: getChoiceOfValues(Object object) very long... [message #604541 is a reply to message #79076] Tue, 10 April 2007 11:48 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31543
Registered: July 2009
Senior Member
Mat,

If possible, you could consider specializing the property descriptor's
getChoiceOfValues methods to not search the entire set of all reachable
objects which is what it's currently doing in order to find all the
objects that are instances of the particular EReference's EClass. I
suppose you could also look into caching the result of either the whole
set, or of just the ones that match a particular EClass, but then you'd
get into issues of when to clear the cache (perhaps after a command is
executed).


Mat Lo wrote:
> Hi,
>
> Yes, my method is time consuming when calling it for a EReference that
> has many objects.
> So it seems very logical that it is time consuming !
> Besides, in my context, this method can be called "recursively" since
> it can be used in a "Copy objects" context. That is I want to copy the
> target object and children of children... These children are not
> necesseraly "econtainment" of other objects, the parent-to-child link
> is functionnal-oriented and not container-to-containment oriented in
> my context.
>
> BUT.
> I hoped it would not take so much time...
> I guess I'm doing something wrong because I spend a lot of time in
> this method...
>
> There is no parametrization I should use ?
>
> Thx
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Teneo: getChoiceOfValues(Object object) very long... [message #604550 is a reply to message #79104] Tue, 10 April 2007 13:30 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Mat,
Refering to the post of Ed, you can use a hql query to only retrieve the objects of a specific type.

gr. Martin

Ed Merks wrote:
> Mat,
>
> If possible, you could consider specializing the property descriptor's
> getChoiceOfValues methods to not search the entire set of all reachable
> objects which is what it's currently doing in order to find all the
> objects that are instances of the particular EReference's EClass. I
> suppose you could also look into caching the result of either the whole
> set, or of just the ones that match a particular EClass, but then you'd
> get into issues of when to clear the cache (perhaps after a command is
> executed).
>
>
> Mat Lo wrote:
>> Hi,
>>
>> Yes, my method is time consuming when calling it for a EReference that
>> has many objects.
>> So it seems very logical that it is time consuming !
>> Besides, in my context, this method can be called "recursively" since
>> it can be used in a "Copy objects" context. That is I want to copy the
>> target object and children of children... These children are not
>> necesseraly "econtainment" of other objects, the parent-to-child link
>> is functionnal-oriented and not container-to-containment oriented in
>> my context.
>>
>> BUT.
>> I hoped it would not take so much time...
>> I guess I'm doing something wrong because I spend a lot of time in
>> this method...
>>
>> There is no parametrization I should use ?
>>
>> Thx
>>


--

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: getChoiceOfValues(Object object) very long... [message #604553 is a reply to message #79104] Tue, 10 April 2007 13:50 Go to previous message
Eclipse UserFriend
Originally posted by: mat.loo.gmail.com

Thx Ed.

Martin, is Teneo able to manage such a cache Ed is talking about ?
Re: Teneo: getChoiceOfValues(Object object) very long... [message #604563 is a reply to message #79149] Tue, 10 April 2007 13:57 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mat,
See my post after Ed. You can use a hql query to just query for a specific eclass. Hibernate
supports session caching as well as level 2 caching (between sessions).

gr. Martin

Mat Lo wrote:
> Thx Ed.
>
> Martin, is Teneo able to manage such a cache Ed is talking about ?
>


--

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
Previous Topic:Teneo: refresh data from DB
Next Topic:Teneo: refresh data from DB
Goto Forum:
  


Current Time: Fri Oct 23 12:34:51 GMT 2020

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

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

Back to the top