cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 

How do I disable Advisor cache for a Java-backed Analysis Report?

mtrapani
Super Contributor

I have a an analysis report I developed with the Java API and the report runs as expected from the modeling tool (windows client) but when I run it from Advisor multiple times in succession, the report is not being run more than the first time but is simple returning the output generated from the first run (the text has the same date-timestamp value I added to the ReportContent that my report returned via the getReportContent method). Clicking on the refresh button on the Advisor report page nor refreshing the page does anything to update the output.  It appears the output is being held in the Advisor cache.  Is there some way to get a handle on the GenerationContext and turn the cache off for this page (analysis report)?  The report has little value if it cannot be generated each time the user runs it!

 

Thanks.

3 Replies

mtrapani
Super Contributor

Thanks for the reply, but I don't want to disable the cache for all Advisor pages, only for reports.  Disabling the cache for all pages would slow down the response time for all users in an unacceptable manner.  Is there a more targeted approach like the Java API approach?

Hi,

 

In order to see the new updates on Advisor, you should disable the KeepAlive parameter on your web.config file by setting the value to 0. The concerned file is located in the Home Directory of the Advisor website ( C:\inetpub\wwwroot\Advisor)

 

<add key="KeepAlive" value="0" />

 

Normally, this configuration will disable the Advisor cache not for the reports only but for the whole website.

 

Thanks

 

Mohamed

mtrapani
Super Contributor

Additional information on my approach...

 

I have implemented the AnalysisReportWithContext interface and defined the getReportContent method as:

 

@Override

public ReportContent getReportContent(MegaRoot megaRoot, Map<String, List<AnalysisParameter>> parameters, Analysis analysis, Object userData)

 

With the reference to the analysis object, I am trying to clear cache two different ways below with the associated output:

 

CODE:

MegaGenerationContext generationContext = (MegaGenerationContext) analysis.getMegaContext();

generationContext.Cache(false);

LOG OUTPUT:

Mon May 20 14:41:15 EDT 2013 : INFO : Clearing cache with line 1: MegaGenerationContext generationContext = (MegaGenerationContext) analysis.getMegaContext();
Mon May 20 14:41:15 EDT 2013 : INFO : Clearing cache with line 2: generationContext.Cache(false);
Mon May 20 14:41:15 EDT 2013 : SEVERE : Error clearing cache: Message: MEGA Error 80070057
Mon May 20 14:41:15 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.api.jni.MappModuleJNI.InvokePropertyPut(Native Method)
Mon May 20 14:41:15 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.api.jni.ComObjectProxy.invokePropertyPut(Unknown Source)
Mon May 20 14:41:15 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.api.util.MegaGenerationContext.Cache(Unknown Source)
Mon May 20 14:41:15 EDT 2013 : SEVERE : Error clearing cache: com.medco.MegaCOE.MegaJavaAnalysisReport.ESRXTRMExtract.getReportContent(ESRXTRMExtract.java:158)
Mon May 20 14:41:15 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.analysis.Analysis.processReport(Unknown Source)
Mon May 20 14:41:15 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.analysis.Analysis.Generate(Unknown Source)
Mon May 20 14:41:15 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.analysis.Analysis.GenerateStream(Unknown Source)

 

CODE:

MegaCOMObject generationContext = analysis.getMegaContext();

generationContext.invokePropertyPut("Cache", Boolean.valueOf(false), new Object[0]);

LOG OUTPUT:

Mon May 20 14:46:11 EDT 2013 : INFO : Clearing cache with line 1: MegaCOMObject generationContext = analysis.getMegaContext();
Mon May 20 14:46:11 EDT 2013 : INFO : Clearing cache with line 2: generationContext.invokePropertyPut("Cache", Boolean.valueOf(false), new Object[0]);
Mon May 20 14:46:11 EDT 2013 : SEVERE : Error clearing cache: Message: MEGA Error 80070057
Mon May 20 14:46:11 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.api.jni.MappModuleJNI.InvokePropertyPut(Native Method)
Mon May 20 14:46:11 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.api.jni.ComObjectProxy.invokePropertyPut(Unknown Source)
Mon May 20 14:46:11 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.api.util.MegaGenerationContext.invokePropertyPut(Unknown Source)
Mon May 20 14:46:11 EDT 2013 : SEVERE : Error clearing cache: com.medco.MegaCOE.MegaJavaAnalysisReport.ESRXTRMExtract.getReportContent(ESRXTRMExtract.java:164)
Mon May 20 14:46:12 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.analysis.Analysis.processReport(Unknown Source)
Mon May 20 14:46:12 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.analysis.Analysis.Generate(Unknown Source)
Mon May 20 14:46:12 EDT 2013 : SEVERE : Error clearing cache: com.mega.modeling.analysis.Analysis.GenerateStream(Unknown Source)