Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325672 - Connection leak in report designer when Edit Data Set dialog encounters error.
Summary: Connection leak in report designer when Edit Data Set dialog encounters error.
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.6.1   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 2.6.2   Edit
Assignee: Mingxia Wu CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard: Obsolete
Keywords:
: 334728 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-18 05:06 EDT by Sam Ellis CLA
Modified: 2011-02-21 04:24 EST (History)
4 users (show)

See Also:


Attachments
Set of mysql commands to create a sample database. (1.42 KB, application/octet-stream)
2010-09-18 05:08 EDT, Sam Ellis CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Ellis CLA 2010-09-18 05:06:35 EDT
Build Identifier: 20100617-1415

I am using Eclipse BIRT Report Designer 2.6.1RC3 to connect to a mysql 5.1 server using com.mysql.jdbc.Driver (v5.1). When an error occurs in the Edit Data Set dialog then I observe that connections to the mysql database are leaked. I am observing the leaks by issuing a "show processlist;" command on the server and seeing the number of connections increasing over time. Examples of errors that trigger this are queries containing SQL parameters '?' that have not been configured, and mandatory parameters that are missing a value. The later case occurs very frequently for me, since although I have set default values, the report designer seems to loose these under some as yet undetermined circumstances (I will raise another bug on this if I can track it down to a reproducible case). I rate the severity of this issue as high; as an example in one hour of use of the report designer sufficient connections had been leaked to exhaust my server of all available connections (180), causing an inadvertent denial of service for all other users. A work-around is to fully exit Eclipse, which causes all the leaked connections to be closed.

Reproducible: Always

Steps to Reproduce:
1. Establish yourself a mysql database (an SQL script to create a sample "booksdb" database is attached).
2. In report designer, create a new report.
2. Create a Data Source to this database using a mysql connector.
3. Create a Data Set to this datasource. The query I used was:

select title, price
from books
where price < ?

Do not configure any parameters (to deliberately cause the query to fail). Click Finish. A sequence of two errors will be reported; click through these. Eventually the Edit Data Source dialog opens.
4. Click Ok to close the Edit Data Source dialog. An error is reported. Click through this too.
5. Log onto your mysql server and issue "show processlist;". Note that there appear to already be a number of leaked connections.
6. Open the Edit Data Set dialog again, preview the query (this will fail), and click Ok to close the dialog.
7. Again issue "show processlist;" on the mysql server and observe that the number of connections has again increased, sometimes by one and sometimes by four.
8. Repeat steps 6 to 7 to cause more leaks...
Comment 1 Sam Ellis CLA 2010-09-18 05:08:31 EDT
Created attachment 179166 [details]
Set of mysql commands to create a sample database.

I run this script as:

mysql -u <username> < books.sql
Comment 2 Xiaoying Gu CLA 2011-02-21 04:08:45 EST
*** Bug 334728 has been marked as a duplicate of this bug. ***
Comment 3 Mingxia Wu CLA 2011-02-21 04:11:05 EST
The cause is that some shutdown or close operations are not in finally block in many cases in UI code.

Fixed.
Comment 4 Xiaoying Gu CLA 2011-02-21 04:24:12 EST
Verified in 2.6.2-20110219. 
Set as verified.