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.
Created attachment 148800 [details] Threaddump If I attempt to cancel a long running query, the IDE hangs. Threaddump attached.
OOps - I missed ths from the original bug report: Product Version: NetBeans IDE 8.0.1 (Build 201408142300) Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12 Database: Pervasive SQL
Looks like getWarnings results in a network request and this seems to take longer (no server response, network down, what ever). The call to getWarnings is issued on the EDT, blocking the whole IDE. While looking at this, I noticed, that without logging the call to getWarnings is useless. So to "fix" this I suggest the following change in DatabaseConnection.java. Before getWarnings was called unconditionally - with this change it is only invoked if logging on the FINE level is enabled. The additional changes (removing LOG just unifies the handling - invoking j.u.l.LOGGER.log does the same test) : # This patch file was generated by NetBeans IDE # It uses platform neutral UTF-8 encoding and \n newlines. --- Base (BASE) +++ Locally Modified (Based On LOCAL) @@ -103,7 +103,6 @@ public final class DatabaseConnection implements DBConnection { private static final Logger LOGGER = Logger.getLogger(DatabaseConnection.class.getName()); - private static final boolean LOG = LOGGER.isLoggable(Level.FINE); static final long serialVersionUID =4554639187416958735L; @@ -324,10 +323,14 @@ return false; } try { + if (LOGGER.isLoggable(Level.FINE)) { + // getWarnings could be blocking - so only call in the debug case + // see bug 246591 SQLWarning warnings = conn.getWarnings(); - if (LOGGER.isLoggable(Level.FINE) && warnings != null) { - LOGGER.log(Level.FINE, "Warnings while trying vitality of connection: " + warnings); + if(warnings != null) { + LOGGER.log(Level.FINE, "Warnings while trying vitality of connection: {0}", warnings); } + } return !checkClosedWithTimeout(conn); } catch (Exception ex) { if (dbconn != null) { @@ -775,9 +778,7 @@ */ @Override public Connection createJDBCConnection() throws DDLException { - if (LOG) { LOGGER.log(Level.FINE, "createJDBCConnection()"); - } if (drv == null || db == null || usr == null ) { throw new DDLException(NbBundle.getMessage(DatabaseConnection.class, "EXC_InsufficientConnInfo")); // NOI18N @@ -959,9 +960,7 @@ } public Task connectAsync() { - if (LOG) { LOGGER.log(Level.FINE, "connect()"); - } Runnable runnable = new Runnable() { @Override
The problem is the same as in 249214 - the patches are in fact mostly the same. Please check, if you can verify the fix (see comment 5 in the mentioned bug). Thank you! *** This bug has been marked as a duplicate of bug 249214 ***
Integrated into 'main-silver', will be available in build *201502020002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/f23f043b4a4d User: Matthias Blaesing <matthias42@netbeans.org> Log: #246591:Integrate missing cleanups from #249214 - remove unecessary logging and move to java7 features