Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Ecore lazy-loading
[CDO] Ecore lazy-loading [message #1227002] Fri, 03 January 2014 09:14 Go to next message
Przemko Robakowski is currently offline Przemko RobakowskiFriend
Messages: 2
Registered: January 2014
Junior Member
In our project we would like to store objects from Ecore package (i.e. we store epackages, eclasses etc) with CDO.
Unfortunately Ecore is treated as legacy package (CDOPackageInfo.isSystemPackage javadoc says that Ecore should be recognize as native but it's not...).
This leads to performance problem: when we for example load one eclass by cdoId, its epackage is also loaded with every elasses from it which is very slow (packages are rather big).
Is there any possibility to use lazy loading with Ecore objects? Or maybe there is some workaround?

Thanks!
Przemko
Re: [CDO] Ecore lazy-loading [message #1227135 is a reply to message #1227002] Fri, 03 January 2014 16:38 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Przemko,

The JavaDoc you've mentioned is definitely wrong and I've just fixed it. From a CDO perspective Ecore is a legacy model
with all the scalability drawbacks. Lazy loading is not possible. On the other hand most Ecore models are fairly small
and prefetching the entire model resource should help a lot:

CDOUtil.getCDOObject(ePackage).cdoPrefetch(CDORevision.DEPTH_INFINITE);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper




Am 03.01.2014 14:22, schrieb Przemko Robakowski:
> In our project we would like to store objects from Ecore package (i.e. we store epackages, eclasses etc) with CDO.
> Unfortunately Ecore is treated as legacy package (CDOPackageInfo.isSystemPackage javadoc says that Ecore should be
> recognize as native but it's not...).
> This leads to performance problem: when we for example load one eclass by cdoId, its epackage is also loaded with
> every elasses from it which is very slow (packages are rather big).
> Is there any possibility to use lazy loading with Ecore objects? Or maybe there is some workaround?
> Thanks!
> Przemko


Re: [CDO] Ecore lazy-loading [message #1232176 is a reply to message #1227135] Thu, 16 January 2014 11:10 Go to previous messageGo to next message
Przemko Robakowski is currently offline Przemko RobakowskiFriend
Messages: 2
Registered: January 2014
Junior Member
Hi Eike,

Thank you for clarification.
The solution that you propose seems not working for me. First thing, if I already have ePackage in hand that means I loaded it already in the slow way, isn't it? And even if I do cdoPrefetch on CDOResource which contains ePackage in tracing I can still see multiple communications with CDO server for every small chunk of data. Even for really small model (like 20 classes with 5-6 attributes each) it takes about 5s to load Shocked (server is n virtual machine in our local lan). Should it be so long?

Cheers,
Przemko
Re: [CDO] Ecore lazy-loading [message #1242247 is a reply to message #1232176] Sun, 09 February 2014 08:05 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 16.01.2014 12:10, schrieb Przemko Robakowski:
> Hi Eike,
>
> Thank you for clarification.
> The solution that you propose seems not working for me. First thing, if I already have ePackage in hand that means I
> loaded it already in the slow way, isn't it?
Hm, that's right. If you know the CDOID of the object to load you can use session-level API to load and prefetch the
needed CDORevisions before you wrap them into EObjects. For example there's this method in CDORevisionManager:

public CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
boolean loadOnDemand);

The revision manager can be obtained with CDOSession.getRevisionManager().

Does that do the trick?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


> And even if I do cdoPrefetch on CDOResource which contains ePackage in tracing I can still see multiple communications
> with CDO server for every small chunk of data. Even for really small model (like 20 classes with 5-6 attributes each)
> it takes about 5s to load 8o (server is n virtual machine in our local lan). Should it be so long?
>
> Cheers,
> Przemko


Re: [CDO] Ecore lazy-loading [message #1242250 is a reply to message #1242247] Sun, 09 February 2014 08:08 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
BTW. if you submit an enhancement request we can certainly add more convenient API to CDOView, something like:

public CDORevision getRevision(CDOID id, int prefetchDepth);

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 09.02.2014 09:05, schrieb Eike Stepper:
> Am 16.01.2014 12:10, schrieb Przemko Robakowski:
>> Hi Eike,
>>
>> Thank you for clarification.
>> The solution that you propose seems not working for me. First thing, if I already have ePackage in hand that means I
>> loaded it already in the slow way, isn't it?
> Hm, that's right. If you know the CDOID of the object to load you can use session-level API to load and prefetch the
> needed CDORevisions before you wrap them into EObjects. For example there's this method in CDORevisionManager:
>
> public CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
> boolean loadOnDemand);
>
> The revision manager can be obtained with CDOSession.getRevisionManager().
>
> Does that do the trick?
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>> And even if I do cdoPrefetch on CDOResource which contains ePackage in tracing I can still see multiple
>> communications with CDO server for every small chunk of data. Even for really small model (like 20 classes with 5-6
>> attributes each) it takes about 5s to load 8o (server is n virtual machine in our local lan). Should it be so long?
>>
>> Cheers,
>> Przemko
>


Previous Topic:[CDO] Can different idGenerationLocations be used on a same server ?
Next Topic:General questions about CDO
Goto Forum:
  


Current Time: Thu Mar 28 13:14:52 GMT 2024

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

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

Back to the top