-
Notifications
You must be signed in to change notification settings - Fork 7
Cache
DEPRECATED Documentation was moved into new docuemntation site
Three caches used:
- Scheme object mapping cache
- Repository descriptors
- Generics cache
When predefined PackageSchemeModule
and AutoScanSchemeModule
object mapping modules used or ObjectSchemeInitializer
used directly, mapped objects are cached.
The is required to avoid redundant computations for registering same types: if models use some base class, then base class would be registered multiple times (for each entity) without cache.
Normally, cache should not cause problems, because scheme is initialized on application start and doesn't changed anymore.
Cashe may be cleared at any time:
@Inject ObjectSchemeInitializer initializer;
...
initializer.clearModelCache();
Repository descriptors computed on first repository method execution and cached to speed up future method executions.
If you use JRebel or other class reloading tool (maybe some other reason) you will need to disable descriptors caching.
To do it set system property or environment variable:
ru.vyarus.guice.persist.orient.repository.core.MethodDescriptorFactory.cache=false
Or from code:
MethodDescriptorFactory.disableCache();
Also you can clear cache manually (on instance):
@Inject MethodDescriptorFactory factory;
...
factory.clearCache()
Note: disabling descriptors case, also disables generics cache.
External library used for generics resolution: generics-resolver. It maintains resolved class generics cache (to avoid resolution for same classes).
Note that disabling descriptors cache will disable generics cache, so usually you dont need to know about it.