[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[birt-report-engine-dev] Caching ExecutionContext?s reportIR object

Hi!

Iâm sorry to bother you with my letter, but I do not know what channel
I should write.
We would lik to change the BIRT code and we do not know whether this
should be published, and if yes, then how.
But first we want to ask for help, that we are on the right way

Briefly describe the problem

We use BIRT 4.2.0 with Weblogic 12c
We have a singleton ReportEngine, caching the ReportRunnable objects
and create and run RunAndRenderTasks

code:
EngineConfig config = new EngineConfig();
reportEngine = new ReportEngine(config);
â
IReportRunnable design = reportEngine.openReportDesign(designInputStream);
â
try {
IRunAndRenderTask task = reportEngine.createRunAndRenderTask(design);
PDFRenderOption options = new PDFRenderOption();
options.setOutputStream(outputStream);
options.setOutputFormat(PDFRenderOption.OUTPUT_FORMAT_PDF);
task.setRenderOption(options);
Map appContext = task.getAppContext();
appContext.put("org.eclipse.datatools.enablement.oda.xml.inputStream",
dataXmlInput);
appContext.put("org.eclipse.datatools.enablement.oda.xml.closeInputStream",
"true");
task.run();
task.close();
return outputStream.toByteArray();
} catch (EngineException e) {
throw new EJBException(e);
} finally {
try {
outputStream.close();
} catch (IOException e) {
}
}

I looked at the BIRT source and realized that each task running, the
ExecutionContext build a Report (reportIR) object. It seems to me,
this object is a model object and does not change after was built.
(Except Reportâs query map and the corresponding maps. But when these
maps is modified, report object is synchronized)
So, I think the report object could be cached, for performance improvement.
(I cached report object, tests the operation, and it seems to work.
But iâm not sure it is a good solution.)

Is it a useful solution caching the report object?
If not, why?
If yes,:
Is there already a working solution?
Is there some limitation, if we work that? (eg.: the same
ReportRunnable object donât create and run task in multiple thread)
If no such solution, and we work out this, how we publish the source?
(We have to publish or not?)

Thanks in advance!
Attila Molnar