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

Bug 330522

Summary: Connection Leak using Dynamic Parameter
Product: z_Archived Reporter: shah.amar
Component: BIRTAssignee: Birt-ReportEngine-inbox <Birt-ReportEngine-inbox>
Status: CLOSED INVALID QA Contact: Xiaoying Gu <bluesoldier>
Severity: critical    
Priority: P3 CC: bluesoldier
Version: unspecified   
Target Milestone: 3.7.0   
Hardware: PC   
OS: Linux   
Whiteboard: Obsolete
Attachments:
Description Flags
Simple Report With Dynamic parameter none

Description shah.amar CLA 2010-11-17 16:33:02 EST
Build Identifier: Eclipse Helios 20100917-0705

Build Identifier: Birt 2.6.1 GA

While testing our reports with Birt 2.6.1 we found that reports that uses dynamic list parameter sees connection leak once deployed on server and accessed through Birt Engine/Viewer API.

We user BIRT Engine API IGetParameterDefinitionTask to retrieve param definition and display it on our own UI. Once custom params screen is shown, user selects params values and submit for report. Report is again generated using BIRT Engine API RunTask & RunAndRenderTask.

We see connection leak each time the report with dynamic parameter is loaded to show its custom parameter input page.

Reproducible: Always

Reproducible: Always

Steps to Reproduce:
To demonstrate and debug issue, I have attached a simple report with connection to oracle, one data set, and one dynamic parameter using data set to fetch value from database. 
Below is the sample table used for this report
CREATE TABLE TEST_DATA
(
  ID    NUMBER,
  DATA  VARCHAR2(100 BYTE)                      NOT NULL
)

Insert into TEST_DATA (ID, DATA) Values (1, 'row_1');
Insert into TEST_DATA (ID, DATA) Values (2, 'row_2');
Insert into TEST_DATA (ID, DATA) Values (3, 'row_3');
COMMIT;

Deploy this report on server side birt viewer. Access the parameter defination of this report using IGetParameterDefinitionTask 
//Code snippet to fetch parameter definations
IGetParameterDefinitionTask task = this.birtEngine
					.createGetParameterDefinitionTask(rptDesign);
Collection params = task.getParameterDefns(true);

Each time the reports parameter definitions are loaded, there is connection opened to DB which is not released.

Keep watching oracless session using below query
SELECT COUNT(*) FROM v$session
Comment 1 shah.amar CLA 2010-11-17 16:35:55 EST
Created attachment 183354 [details]
Simple Report With Dynamic parameter
Comment 2 Xiaoying Gu CLA 2010-11-18 02:49:11 EST
Have you called task.close() after executing:
Collection params = task.getParameterDefns(true);

The connections are released in the task.close().
Comment 3 Xiaoying Gu CLA 2010-11-18 21:59:45 EST
Set as invalid based on comment#2.

Please feel free to reopen if there is any further issues.
Comment 4 Xiaoying Gu CLA 2010-11-18 22:00:02 EST
update status.