This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 188741 - Warn if ConnectionManager.showConnectionDialog is called outside EDT
Summary: Warn if ConnectionManager.showConnectionDialog is called outside EDT
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-16 21:28 UTC by Eduardo.m Costa
Modified: 2014-10-05 18:40 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eduardo.m Costa 2010-07-16 21:28:32 UTC
Following this recipe:

DatabaseConnection dbc = ConnectionManager.getDefault().getConnection(databaseConnectionName);
ConnectionManager.getDefault().showConnectionDialog(dbc);
Connection conn = dbc.getJDBCConnection(true);

When running on EDT, DatabaseConnection.getJDBCConnection emits a warning about not calling it on EDT. OK.

When running outside EDT (a RequestProcessor or similar), ConnectionManager.showConnectionDialog runs fine, but creates a race condition, since its dialog's setVisible is not called on EDT and returns immediately.

Since DatabaseConnection.getJDBCConnection warns me about using EDT, ConnectionManager.showConnectionDialog must do the same (IMHO), since this behaviour is not explicit on its documentation.
Comment 1 matthias42 2014-10-05 18:40:43 UTC
In DatabaseConnection#showConnectionDialog (around line 1233) the EDT relevant part is dispatched into the EDT via Mutex.EVENT#readAccess.