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 137746 - IDE still try to connect to DB after canceling
Summary: IDE still try to connect to DB after canceling
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Rob Englander
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-19 16:58 UTC by Roman Mostyka
Modified: 2008-08-21 18:36 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-06-19 16:58:42 UTC
1. Try to connect to some DB, but with wrong settings (I used wrong port).
2. Click "Cancel" button.

Result: Message "Connecting to database..." is still in status bar, I guess that attempt to connect isn't canceled.
Comment 1 David Vancouvering 2008-06-19 18:23:41 UTC
I think the progress bar just doesn't get closed, I don't think it's still trying to connect.

I don't believe this is a P2 - it's not preventing the user from being productive.
Comment 2 Rob Englander 2008-08-18 17:18:11 UTC
I've been trying this on Mac OS and can't reproduce it.  The "Connecting to database" in the progress bar
doesn't persist.  In fact it doesn't even seem to appear after the 1st try, although that just may be that it goes by
too fast.  

In any case I'm not sure this scenario should be dumping an exception.  Although the drivers throw exceptions, maybe we
can be smarter about dealing with this and present something a bit more useful to the user.  Is it worth the effort?
Comment 3 David Vancouvering 2008-08-18 18:29:44 UTC
I think what you need for this is a server that hangs the client.  Have you tried with MySQL?  How about MySQL on a
remote machine?  Catch me on IM and I can point you to some servers on the Sun network.

In terms of how we should report the exception, we shoud discuss this at i-team.  There are a number of discussions
about exception reporting going on and it would be good to come to some agreement about this.
Comment 4 Roman Mostyka 2008-08-19 12:33:44 UTC
I always can reproduce this on Windows XP.
I haven't tried with MySQL, but I tried also with valid settings for bundled Java DB. If Java DB is starting too slow,
then after 5 second I see dialog and click "Cancel" in it to cancel attempt to connect. But IDE still tries to establish
connection.
And message in the dialog is quite informative, just after canceling process should be stopped (even if it is only in
progress bar).
Comment 5 Rob Englander 2008-08-20 17:30:05 UTC
OK, I can see by inspection how this happens.  The Cancel button remains enabled during the connection process.  So this
isn't an issue only for attempting a connection with bad parameters.  This can happen for a good connection attempt as
well.  If the connection setup is slow enough to give the user a chance to click Cancel we have the same situation.

Clearing the progress handle is simple.  But I think there's another issue, which is more important.  What happens if
the user cancels the connection dialog and then the async connection process completes and fires its event?  I'm not
sure what will happen at the moment, but the correct behavior would not show itself in any way after the user has
canceled.  So we'll want to keep track of the fact that there's an outstanding request.  Anyone have any thoughts on
this for the near term?  Fixing the progress handle is a 15 minute job from here.  The rest requires some actual thought.
Comment 6 Rob Englander 2008-08-20 21:26:31 UTC
1052fe547413
Comment 7 Quality Engineering 2008-08-21 06:03:15 UTC
Integrated into 'main-golden', available in build *200808210201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/e8b2a38afa99
User: Rob Englander <mindstream@netbeans.org>
Log: #137746 Terminate progress bar if user presses cancel in New Connection dialog.
Comment 8 Roman Mostyka 2008-08-21 18:36:16 UTC
Verified with build 080821.