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

Bug 366970

Summary: Crosstab report runs ODA query three times if the query returns zero rows
Product: z_Archived Reporter: Mark Mising name <mark.mills>
Component: BIRTAssignee: Birt-ReportEngine-inbox <Birt-ReportEngine-inbox>
Status: NEW --- QA Contact: Hao Zhou <hao.zhou>
Severity: normal    
Priority: P3 CC: bluesoldier
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Test files none

Description Mark Mising name CLA 2011-12-16 14:04:10 EST
Build Identifier: v20110913-1734

I have built a custom ODA driver and if it is supplying data for a crosstab and its query returns no data, the ODA Query.prepare and execute methods are called three times. If the query returns one or more rows, the prepare and execute are called only once. My query that returns zero rows takes about a minute to run, so runing the report takes three minutes instead of just one.

For testing, I built a simple ODA driver using the instructions on the community forum. It logs messages to c:/temp/TestOdaQuery.txt.

Reproducible: Always

Steps to Reproduce:
1. Install the attached dummyoda plugin jars into a BIRT RCP designer's plugins folder
2. Launch the RCP designer and open the attached TestOdaCrosstab.rptdesign report design
3. Edit the data set and set the Query Text value to a number greater than 0 (the number of rows to return).
4. Preview the report.
5. Open the file c:/temp/TestOdaQuery.txt and notice that after the Initialized message, prepare and executeQuery methods are each logged once, as follows:

*** Initialized
Called Query.prepare() with queryText='5'
Called Query.executeQuery() with max rows=5

6. Close the file, edit the data set, and set the Query Text value to 0.
4. Preview the report.
5. Open the file c:/temp/TestOdaQuery.txt and notice that after the Initialized message, prepare and executeQuery methods are each logged three times as follows:

*** Initialized
Called Query.prepare() with queryText='0'
Called Query.executeQuery() with max rows=0
Called Query.prepare() with queryText='0'
Called Query.executeQuery() with max rows=0
Called Query.prepare() with queryText='0'
Called Query.executeQuery() with max rows=0
Comment 1 Mark Mising name CLA 2011-12-16 14:06:52 EST
Created attachment 208500 [details]
Test files

A zip file containing a dummy ODA plugin and a test report design.