Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
DataSet query execution
Anita Mathew
As I was debugging one of my reports, I noticed that the DataSet query is being executed in the report's initialize() method and then again before the beforeFactory() task. Is there a reason why this happens twice?
Any insight would be great.
Thanks,
A.
Find more posts tagged with
Comments
mwilliams
Hi A,
I would assume that these are not full runs of your query. Probably just runs to determine field names, etc. If I find anything different out on this, I'll let you know.
Anita Mathew
What do you mean by not a full run? I'm using a custom ODA plugin which parses an XML file. This means each time the query is executed, the entire XML file is re-parsed. As far as I understand it's not possible to have a partial run. This seems inefficient and unnecessary.
Isn't there supposed to be some sort of dataset caching in Birt from version 2.3 onwards? I'm using version 2.5.2.
Thanks,
A.
mwilliams
A,
Yes, there is supposed to be better caching in newer versions. I was talking about with SQL at least, I believe the dataSet is accessed and the column names are at least obtained. I could be wrong. I'll check into this and let you know what I find.
mwilliams
One quick question. Do you have a dynamic parameter used in your report?
Anita Mathew
Some reports that I use do, but this behavior was exhibited in reports that don't as well.
On a slightly related note, if there are multiple charts and/or tables in a report that access the same dataset, is the query executed repeatedly for each chart/table? Does BIRT do the said caching or is that within the realm of the ODA plugin?
Thanks so much for the quick response,
A.
mwilliams
A,
Sorry for the delayed reply. The .org site was being upgraded over the weekend.
From what I understand, the query should not run before the beforeFactory unless there is a dynamic parameter. As for each chart and table hooked to the same dataSet forcing the query to run, I was under the impression that it did not rerun the query again. The exception I've seen to this is when an embedded table is filtered, the query seems to rerun according to someone I've worked with previously.
Anita Mathew
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="65233" data-time="1275427970" data-date="01 June 2010 - 02:32 PM"><p>
the query should not run before the beforeFactory unless there is a dynamic parameter. <br /></p></blockquote>
<br />
The report does have a parameter but the chart for which the dataset query is executed in the initialize() method does not depend on this parameter in anyway. Why would it run in the initialize and beforeFactory irrespective?<br />
<br />
Thanks.
jonc
I am having a similar issue. I do have dynamic parameters in my report that I apply to data sets that all use a scripted data source in my initialize() method on the report. I do not want this method to be run twice for the report as I'm loading all necessary data the first time.
Why is this being called twice? Is there any way prevent that?
mwilliams
Are you saying the initialize method runs twice? Or the beforeFactory?
jonc
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="72062" data-time="1294697245" data-date="10 January 2011 - 03:07 PM"><p>
Are you saying the initialize method runs twice? Or the beforeFactory?<br /></p></blockquote>
<br />
<br />
<br />
The initialize method runs twice. Since this is where I run all my queries I know it is run twice from both logging that I have placed in it as well as logging my queries all do in my test environment showing the SQL run.