Data sources with non-serializable data and data set caching [message #491785] |
Thu, 15 October 2009 20:16 |
Andreas Mayer Messages: 32 Registered: July 2009 |
Member |
|
|
Hi,
I am using a home-made ODA driver, which provides data sources for EMF
models. The driver makes use of the newly added Java Object type [1] to
return the original model objects, which enables you to access them in
JavaScript expressions. For example, you can write row["type"].name to
avoid more complex constructions to navigate the model. So far so good.
Under certain circumstances BIRT serializes query results to cache them
during report generation (see [2]). It seems the cache kicks in as soon
as a data set is used more than once in a report -- even if both
instances use different parameter bindings and yield different results.
The problem is that EMF model objects are usually not serializable and
BIRT's caching mechanism throws an exception in this case.
However, in my opinion it doesn't make much sense to cache data from an
in-memory model to disk. Therefore, I would like to disable the data set
caching to avoid this problem. The best would be if the ODA driver could
provide BIRT with a hint that it should not cache its data at all. Is
there a way to do this? I haven't found one.
Browsing through BIRT's code [3] I've seen some indications which imply
that the caching meachnism is configurable. Unfortunately the
corresponding settings seem not to be available in the report designer.
Is there any other way to disable caching per data source, data set, or
report out of the box/without using the API?
[1] https://bugs.eclipse.org/285108
[2] https://bugs.eclipse.org/178897#c14
[3] DataSourceQuery.execute(), DataSetCacheManager, DataSetCacheConfig, ...
--
Andreas
|
|
|
|
Re: Data sources with non-serializable data and data set caching [message #501788 is a reply to message #501385] |
Thu, 03 December 2009 19:11 |
Andreas Mayer Messages: 32 Registered: July 2009 |
Member |
|
|
Hi,
Lin Zhu wrote:
> So far it is not configurable for the data set caching. A would around
> would be define data set with different names, the data of which is
> however same, and use each data set only once in the report design.
> This will automatically switch off the data set caching.
There are still situations, in which BIRT insists on persisting the
result sets. For example, the web viewer seems to rely on a disk cache
no matter if data sets are used more than once.
> On the other hand, data set w/ different parameter value should not be
> cached. What is the version of BIRT you are using? It seems a bug.
The class EngineExecutionHints uses only the names of the data sets to
decide whether the result sets need to be cached (in which case the
result will be persisted and therefore has to be serialized). However,
later on DataSetCacheManager uses both, the name and the parameter
hints, to decide whether the persisted result is actually re-used.
But these are not the only places in BIRT's code concerned with
caching/persisting. Therefore, I don't know if working around this one
solves my issue once and for all.
I use BIRT 2.5.1. I've just attached my driver and an example report to
[1]. So you may see for yourself.
[1] https://bugs.eclipse.org/132958
--
Andreas
|
|
|
|
Powered by
FUDForum. Page generated in 0.03771 seconds