[ 
https://issues.apache.org/jira/browse/ISIS-2888?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Keir Haywood updated ISIS-2888:
--------------------------------------
    Description: 
observed numerous calls to findByUsername going to the database,
 
Have tried various configuration settings to change EclipseLink cache behaviour 
but they don’t seem to make a difference.
 
One of them was trying to use QueryMonitor to log cache hits but couldn’t make 
that output anything. Simple observation of the page showed by rough count of 
time that page load didn’t vary with different configuration settings.
 
Perhaps @Cache is required on ApplicationUser?
 
Earlier attempts to use QueryResultsCache didn’t work out either since hit the 
issue with ObjectBulkLoader (https://issues.apache.org/jira/browse/ISIS-2330); 
but think more important is using EclipseLink caching.  
Using that caching would be more likely to make a big difference and dealing 
with clearing the cache can be done at a later date if we need to write direct 
to the database.
 
Any luck with settings to log output from EclipseLink’s QueryMonitor or 
PerformanceMonitor?
~~~

addendum; things attempted:
 
 - various EclipseLink settings and did find with 
eclipselink.profiler=QueryMonitor that I could reload the dashboard page and 
see some output.
This showed that caching was happening for primary key based requests but not 
others.
 
 - Using XML to configure the named queries gave an error about the class not 
having an id and seemed to be to do with the inheritance and where things were 
set - various combinations of which class used didn't help.
 
 - tried to no avail finding a way to have my own named queries so I could set 
the hint on them.
 
 - tried again with wrapping the findByUsername with queryResultsCache but that 
gave errors about not being in an interaction context when setting up 
queryResultsCache bean.
 
 
Final solution that was hacked: rudimentary caching in overridden version of 
AuthorizorSecman.

  was:
things attempted:
 
- various EclipseLink settings and did find with 
eclipselink.profiler=QueryMonitor that I could reload the dashboard page and 
see some output.
This showed that caching was happening for primary key based requests but not 
others.
 
- Using XML to configure the named queries gave an error about the class not 
having an id and seemed to be to do with the inheritance and where things were 
set - various combinations of which class used didn't help.
 
- tried to no avail finding a way to have my own named queries so I could set 
the hint on them.
 
- tried again with wrapping the findByUsername with queryResultsCache but that 
gave errors about not being in an interaction context when setting up 
queryResultsCache bean.
 
 
Final solution that was hacked: rudimentary caching in overridden version of 
AuthorizorSecman.


> Use EclipseLink for caching of "findByUsername" and similar security queries.
> -----------------------------------------------------------------------------
>
>                 Key: ISIS-2888
>                 URL: https://issues.apache.org/jira/browse/ISIS-2888
>             Project: Isis
>          Issue Type: Improvement
>            Reporter: Daniel Keir Haywood
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> observed numerous calls to findByUsername going to the database,
>  
> Have tried various configuration settings to change EclipseLink cache 
> behaviour but they don’t seem to make a difference.
>  
> One of them was trying to use QueryMonitor to log cache hits but couldn’t 
> make that output anything. Simple observation of the page showed by rough 
> count of time that page load didn’t vary with different configuration 
> settings.
>  
> Perhaps @Cache is required on ApplicationUser?
>  
> Earlier attempts to use QueryResultsCache didn’t work out either since hit 
> the issue with ObjectBulkLoader 
> (https://issues.apache.org/jira/browse/ISIS-2330); but think more important 
> is using EclipseLink caching.  
> Using that caching would be more likely to make a big difference and dealing 
> with clearing the cache can be done at a later date if we need to write 
> direct to the database.
>  
> Any luck with settings to log output from EclipseLink’s QueryMonitor or 
> PerformanceMonitor?
> ~~~
> addendum; things attempted:
>  
>  - various EclipseLink settings and did find with 
> eclipselink.profiler=QueryMonitor that I could reload the dashboard page and 
> see some output.
> This showed that caching was happening for primary key based requests but not 
> others.
>  
>  - Using XML to configure the named queries gave an error about the class not 
> having an id and seemed to be to do with the inheritance and where things 
> were set - various combinations of which class used didn't help.
>  
>  - tried to no avail finding a way to have my own named queries so I could 
> set the hint on them.
>  
>  - tried again with wrapping the findByUsername with queryResultsCache but 
> that gave errors about not being in an interaction context when setting up 
> queryResultsCache bean.
>  
>  
> Final solution that was hacked: rudimentary caching in overridden version of 
> AuthorizorSecman.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to