Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary backend lookups in Store.eObject(Id) #56

Closed
gdaniel opened this issue Jan 19, 2017 · 0 comments
Closed

Unnecessary backend lookups in Store.eObject(Id) #56

gdaniel opened this issue Jan 19, 2017 · 0 comments

Comments

@gdaniel
Copy link
Contributor

gdaniel commented Jan 19, 2017

All DirectWrite[xx]Store have an implementation of eObject(Id) that looks in the cache if the object has been loaded to avoid database calls. However, the cache lookup is initialized with new PersistentEObjectCacheLoader(eClass), that is called if the cache does not contain the requested element.
The eClass parameter of the loader forces the framework to find the EClass of the object in the backend before the cache lookup. This is not useful if the object is in the cache.

A more efficient implementation would be to initialize the PersistentEObjectCacheLoader with the id, and compute the corresponding EClass only if we need to load the object from the database (in the apply method).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant