[CDO] Ecore lazy-loading [message #1227002] |
Fri, 03 January 2014 04:14  |
Eclipse User |
|
|
|
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 #1242247 is a reply to message #1232176] |
Sun, 09 February 2014 03:05   |
Eclipse User |
|
|
|
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 03:08  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.06031 seconds