Bug 188741 - Warn if ConnectionManager.showConnectionDialog is called outside EDT
Warn if ConnectionManager.showConnectionDialog is called outside EDT
Status: RESOLVED FIXED
Product: db
Classification: Unclassified
Component: Code
6.x
All All
: P3 (vote)
: TBD
Assigned To: Libor Fischmeistr
issues@db
:
Depends on:
Blocks:
  Show dependency treegraph
 
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
:


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.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo