Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332678

Summary: Nested tables don't use dataset cache where query will not change
Product: z_Archived Reporter: Pinny Markowitz <pinny>
Component: BIRTAssignee: Zhiqiang Qian <zqian>
Status: VERIFIED WORKSFORME QA Contact: H N <hng>
Severity: enhancement    
Priority: P3 CC: andras_szopko, bluesoldier, hng, zqian
Version: 2.6.1   
Target Milestone: 4.4.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Pinny Markowitz CLA 2010-12-15 14:51:06 EST
Build Identifier:  20100917-0705

If a report has a parent table (tableA) using a dataset (ds1), and a nested table within (tableB) using another dataset (ds2).  tableB defines a filter to only use dataset rows where row['id'] match row._outer['id']. The query for 'ds2' will be executed for each row returned by 'ds1' even though the binding for table2 doesn't specify any dataset parameters and the query is exactly the same each time.  This may be considered expected behavior, however it still doesn't provide a method to call the database only one time, while using filtering to provide the needed parent-child relationship.

A workaround suggested on the newsgroup is to nest tableA within the footer of a new 'wrapper' table (tableX) that is bound to 'ds2'.  This causes the result for 'ds2' to be cached, and no more queries are executed for 'ds2'.  An interesting problem with this solution is where the result of the query for 'ds2' returns 0 rows of data.  In this case, the cache appears to be ignored, perhaps because it is empty, and behavior reverts to query the database for each row returned by 'ds1'.  Forcing a dummy row to return can be a workaround for this, but that may not always be an option.

Reproducible: Always
Comment 1 Zhiqiang Qian CLA 2014-07-23 14:12:13 EDT
This was fixed.
Comment 2 H N CLA 2014-09-17 14:07:44 EDT
Verified that when opening a report contains nested table using a different dataset, the data source will be accessed once.

Verified in BIRT 4.4.1 build v20140916-1320.