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 142036 - org.netbeans.api.db.explorer.DatabaseException: The connection is not open
Summary: org.netbeans.api.db.explorer.DatabaseException: The connection is not open
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: David Vancouvering
URL: http://statistics.netbeans.org/except...
Keywords:
: 141796 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-29 11:51 UTC by Roman Mostyka
Modified: 2008-07-31 15:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 83532


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-07-29 11:51:00 UTC
Build: NetBeans IDE Dev (Build 080728)
VM: Java HotSpot(TM) Client VM, 11.0-b13, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b26
OS: Windows XP, 5.1, x86

User Comments: 
1. Connect to MySQL server.
2. Rightclick it's node and choose "Create Database...".
3. Select some database and click "OK".

Result: DatabaseException arises.

Stacktrace: 
org.netbeans.api.db.explorer.DatabaseException: The connection is not open
        at org.netbeans.modules.db.api.sql.execute.SQLExecutor.execute(SQLExecutor.java:87)
        at org.netbeans.modules.db.mysql.impl.BaseSampleProvider.create(BaseSampleProvider.java:98)
        at org.netbeans.modules.db.mysql.impl.SampleManager.createSample(SampleManager.java:121)
        at org.netbeans.modules.db.mysql.ui.CreateDatabasePanel$1.run(CreateDatabasePanel.java:153)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Comment 1 Roman Mostyka 2008-07-29 11:57:06 UTC
Sample databases can't be created. Feature doesn't work.
Comment 2 David Vancouvering 2008-07-29 17:10:33 UTC
Yes, I just saw this too.  I had encountered this during my testing prior to going on vacation and thought I had fixed
it, but it appears to have reared it's ugly head again.
Comment 3 David Vancouvering 2008-07-29 20:49:35 UTC
*** Issue 141796 has been marked as a duplicate of this issue. ***
Comment 4 David Vancouvering 2008-07-29 22:08:18 UTC
Andrei backed out the change I made for Issue 138072 to fix the regression I created for Issue 137811 (thanks, Andrei. 
Next time send me an email so I know what happened :)).

I have to think about what to do here - the DB Explorer relies on two ConnectionNodeInfos being equal because their
names are the same, but this causes problems for the Node ChildFactory implementation because it requires that the data
used to compare two nodes be immutable - see Issue 137811 for more details.

This wasn't a problem until I rewrote the DB Explorer to use ChildFactory rather than it's old ugly broken way of doing
things. 

So, this means I am going to have to rework how the DB Explorer sets up a connection as connected.  Yuck, this is hairy
code.
Comment 5 Andrei Badea 2008-07-30 10:36:19 UTC
Sorry for not sending an e-mail, but I didn't know I was reverting an intentional change. I expected ConnectionNodeInfo
was not fixed as part of the changeset in 137811 desc9.
Comment 6 David Vancouvering 2008-07-30 19:45:03 UTC
I found a solution - when refreshing the connection node list, I re-associate the opened connection with the new node
info that gets created as part of the refresh.

Change set b8fce80970ea.
Comment 7 Roman Mostyka 2008-07-31 09:54:45 UTC
Verified with build 080731.
Comment 8 Quality Engineering 2008-07-31 15:44:22 UTC
Integrated into 'main-golden', available in build *200807311401* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/65f95aa97eb9
User: David Van Couvering <davidvc@netbeans.org>
Log: #142036: Connection is closed when trying to create sample database for MySQL
Caused by an accidental backing out of my fix for Issue 138072