Understanding Cache Regions

Topics related to the standard LSPS process application.
Forum rules
Make sure every topic contains information about your LSPS version and if relevant also your server OS, client OS, database name and version, and application server name and version.
matt.price
 
Posts: 66
Joined: Thu May 03, 2012 11:51 pm

Understanding Cache Regions

Fri Aug 05, 2016 5:40 pm

From here: https://docs.whitestein.com/lsps/3_1/pds/CacheRegions.html

Trying to understand where the caching regions would be in effect. Or how the cache is keyed?

A: Given, cache region exists for SomeSharedRecord and cached region is empty.
When,
Code: Select all
def SomeSharedRecord ssr1 := findById(7, SomeSharedRecord);
def SomeSharedRecord ssr2 := findById(7, SomeSharedRecord);

Then, ssr2 is pulled from cache.

B: Given, cache region exists for SomeSharedRecord and cached region is empty.
Given, findSomeSharedRecords is a query that has a parameter of primary keys as a Set and the condition simply uses the set in an in clause (iterator.pk in pkSet)
When,
Code: Select all
def SomeSharedRecord ssr1 := findById(7, SomeSharedRecord);
def List<SomeSharedRecord> ssrs := findSomeSharedRecords({5, 6, 7});

Then, the element in ssrs that represents 7, was not pulled from cache.

Are examples A and B true? I'm assuming query results are not cached.

Roman Kubascik
 
Posts: 57
Joined: Thu Apr 16, 2015 9:05 am

Re: Understanding Cache Regions

Tue Aug 09, 2016 3:55 pm

Hi Matt,

yes, you are right, both A and B are true. Queries are not cached.

Regards,
Roman

matt.price
 
Posts: 66
Joined: Thu May 03, 2012 11:51 pm

Re: Understanding Cache Regions

Tue Aug 09, 2016 8:25 pm

Roman, thanks for the verification.

Is log output like this indicative of some application server setting that needs to be flipped? I've tried with -Dnet.sf.ehcache.disabled=false added to the startup config.

[Wildfly 9.0.2.Final]
2016-08-09 13:01:47,644 WARN [net.sf.ehcache.Cache] (default task-22) Cache: businessrules%3A%3Arules is disabled because the net.sf.ehcache.disabled property was set to true. No elements will be added to the cache.
2016-08-09 13:01:47,644 WARN [net.sf.ehcache.Cache] (default task-22) Cache: SHARED_RECORDS_REGION is disabled because the net.sf.ehcache.disabled property was set to true. No elements will be added to the cache.
2016-08-09 13:01:47,847 WARN [net.sf.ehcache.config.CacheConfiguration] (default task-22) Cache 'businessrules%3A%3Arules' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'businessrules%3A%3Arules' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
2016-08-09 13:01:47,863 WARN [net.sf.ehcache.Cache] (default task-22) Cache: businessrules%3A%3Arules is disabled because the net.sf.ehcache.disabled property was set to true. No elements will be added to the cache.
2016-08-09 13:01:47,863 WARN [net.sf.ehcache.Cache] (default task-22) Cache: SHARED_RECORDS_REGION is disabled because the net.sf.ehcache.disabled property was set to true. No elements will be added to the cache.

Roman Kubascik
 
Posts: 57
Joined: Thu Apr 16, 2015 9:05 am

Re: Understanding Cache Regions

Wed Aug 10, 2016 8:36 am

Default value of the net.sf.ehcache.disabled is false, so you don't have to override it. Isn't it activated somewhere? (e.g. JAVA_OPTS)
Please check the log of the server. Do you see there anything about net.sf.ehcache.disabled ? Check section "Configured system properties:".
BTW Is "rules" cache defined usual way in PDS? PDS uses regular hibernate with ehcache.

Roman Kubascik
 
Posts: 57
Joined: Thu Apr 16, 2015 9:05 am

Re: Understanding Cache Regions

Fri Aug 12, 2016 10:51 am

Caches are created as disabled and they are enabled later. So it's ok to see in the log message like:
Cache: businessrules%3A%3Arules is disabled because the net.sf.ehcache.disabled property was set to true. No elements will be added to the cache.

but you should also see message:
Cache: businessrules%3A%3Arules is enabled.

Return to Process application

Who is online

Users browsing this forum: No registered users and 1 guest