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 67241 - [50cat] Database query will not run
Summary: [50cat] Database query will not run
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-20 21:06 UTC by eriktamu
Modified: 2005-11-18 20:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump from netbeans. (3.56 KB, text/plain)
2005-10-20 21:08 UTC, eriktamu
Details
Log output (14.79 KB, text/rtf)
2005-10-24 16:14 UTC, eriktamu
Details
DB Explorer module with logging (907.26 KB, application/octet-stream)
2005-10-24 18:06 UTC, Andrei Badea
Details
output with new datbase jar file. (22.65 KB, text/plain)
2005-10-24 18:27 UTC, eriktamu
Details
New DB Exp module (907.35 KB, application/octet-stream)
2005-10-25 11:05 UTC, Andrei Badea
Details
Solaris-sparc output (17.60 KB, text/plain)
2005-10-28 19:15 UTC, eriktamu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description eriktamu 2005-10-20 21:06:41 UTC
[ BUILD # : 200510131600 ]
[ JDK VERSION : 1.4.2_xx ]

For several builds I have had this issue.  I will connect to a database 
and will try to run a query.  Sometimes it works the first time 
sometimes it doesn't.  It never works more than once.  I get a pop-
up error that the connection is already established.  All I have done 
is try to execute the query.  I will attach a thread dump.  Each time I 
try clicking on the run query button nothing happens.
Comment 1 eriktamu 2005-10-20 21:08:26 UTC
Created attachment 26187 [details]
Thread dump from netbeans.
Comment 2 Andrei Badea 2005-10-24 12:26:57 UTC
I'm sorry the attached "thread dump" doesn't help much. First, it isn't a thread
dump, it is probably a part of the message log. Second, the exceptions in it
aren't caused by trying to run a command. Are you able to reproduce the issue
starting from a fresh userdir? If yes, please attach reproducible steps. If any
exceptions are logged to the message log or the console when you invoke the "Run
SQL" action, please attach them too.
Comment 3 eriktamu 2005-10-24 16:12:16 UTC
Reproducible Steps:

1. Deleted .netbeans folder in user dir.
2. Started Netbeans, accepted license
3. Clicked on Runtime section, expanded Databases, Drivers (to ensure there wasn't any).
4. Added Oracle database driver
5. Started connection wizard and entered information (clicked on save password checkbox).
6. Right clicked on Database and chose: Execute Command
7. Was in the process of typing sql statemend when I received the following popup:

     Unable to add connection, connection already exists

Clicking on Run Sql gives me no indication that I clicked on the button.  I will include OS X log.

??  How can I get you a thread dump ??
Comment 4 eriktamu 2005-10-24 16:14:15 UTC
Created attachment 26282 [details]
Log output
Comment 5 Andrei Badea 2005-10-24 18:05:19 UTC
Still no clue :-( I'll need some help in order to trace the issue. I will attach
a version of the Database Explorer module with some logging. Please copy it to
<netbeans>/ide6/modules (replace the existing one) and start NetBeans with a
fresh userdir and using the command:

netbeans -J-Dorg.netbeans.modules.db=0

Try to repeat your steps and attach the message log to this issue (there will be
some messages starting with
"[org.netbeans.modules.db.explorer.DatabaseConnection]" in it). Thanks!

BTW what happens if you wait a bit (say 30 s) before invoking Execute Command?
Or when you restart NetBeans after adding the db connection, but before invoking
Execute Command? It would be nice if you could try this as well (with the
logging database explorer module, so I can see what's going on).
Comment 6 Andrei Badea 2005-10-24 18:06:22 UTC
Created attachment 26292 [details]
DB Explorer module with logging
Comment 7 eriktamu 2005-10-24 18:27:40 UTC
Created attachment 26293 [details]
output with new datbase jar file.
Comment 8 Andrei Badea 2005-10-25 11:03:56 UTC
Thank you, that helped a bit. Now I see the connection used to execute the SQL
statement is null. No idea why this is happening though, so I'm attaching a new
version of the module with some assert statements. Please test and attach the
new message log.

BTW which version of the Oracle driver are you using?
Comment 9 Andrei Badea 2005-10-25 11:05:34 UTC
Created attachment 26306 [details]
New DB Exp module
Comment 10 eriktamu 2005-10-27 20:46:22 UTC
I've found the same results on a solaris-sparc machine that I'm working on.  Can
I test this out the same way?
Comment 11 Andrei Badea 2005-10-28 17:34:01 UTC
Yes, the same way. Start with a clean userdir, add the connection and invoke the
Execute Command action. Then attach the message log to the issue.
Comment 12 eriktamu 2005-10-28 19:15:03 UTC
Tried the same thing with my solaris-sparc box getting the same results.  I can
run 4.1 in exactly the same manner on both the mac and solaris box and have it
work fine.  I'm not sure exactly what version of the oracle driver that I'm
using.  Should I include it?  I'm attaching the most recent output.  Would you
like me to do it on my mac too?
Comment 13 eriktamu 2005-10-28 19:15:55 UTC
Created attachment 26431 [details]
Solaris-sparc output
Comment 14 Andrei Badea 2005-10-28 19:30:50 UTC
The message log wasn't obtained using the last db module I attached. Could you
please do it again with the db module that I attached on Oct 25 at 10:05:00?
Since the bug is reproducible on both Sparc and Mac, it's enough to do it on one
computer/operating system only.

BTW, the NetBeans build you are using is two weeks old. Could you also try to
test with the newest daily build? No need to attach the message log, I just need
to know if you can reproduce the bug.

And finally: I understand you are a Sun employee, could you please write me an
e-mail (to andrei.badea@sun.com)? Thanks.
Comment 15 Andrei Badea 2005-11-01 10:37:34 UTC
The cause of the issue is that the Add Connection dialog retrieves all the
schemas in the database when the connection is realized. When the retrieval
process takes a long time, it it possible to click OK in the dialog and add the
connection before the retrieval process is finished. In the meanwhile the
process continues in the background and when it finished it tries to add the
connection for the second time.

The fix will be to disable the OK button in the Add Connection dialog while the
schemas are retrieved and display a progress dialog. Unfortunately adding the
connection will take long for databases with many schemas (such as the
reporter's database, which has over 10000 schemas).

The Add Connection dialog tries to find a schema with the same name as the
connection's user name. If it finds one, the connection is set to use it and the
dialog is closed.Otherwise the Advanced tab is activated and the user must
select a schema. If anyone knows how to reliably, quickly and in a
non-database-specific way detect whether a given schema exists in the database,
I'd like to hear about it. This would allow to skip the retrieval of all schemas
when the schema named like the user exists, which is a common case.
Comment 16 Andrei Badea 2005-11-08 17:54:24 UTC
Fixed as described above.

Checking in org/netbeans/modules/db/explorer/actions/ConnectAction.java;
/cvs/db/src/org/netbeans/modules/db/explorer/actions/ConnectAction.java,v  <-- 
ConnectAction.java
new revision: 1.39; previous revision: 1.38
done
Checking in org/netbeans/modules/db/explorer/actions/ConnectUsingDriverAction.java;
/cvs/db/src/org/netbeans/modules/db/explorer/actions/ConnectUsingDriverAction.java,v
 <--  ConnectUsingDriverAction.javanew revision: 1.29; previous revision: 1.28
done
Checking in org/netbeans/modules/db/explorer/dlg/ConnectPanel.form;
/cvs/db/src/org/netbeans/modules/db/explorer/dlg/ConnectPanel.form,v  <-- 
ConnectPanel.form
new revision: 1.4; previous revision: 1.3
done
Checking in org/netbeans/modules/db/explorer/dlg/ConnectPanel.java;
/cvs/db/src/org/netbeans/modules/db/explorer/dlg/ConnectPanel.java,v  <-- 
ConnectPanel.java
new revision: 1.17; previous revision: 1.16
done
Checking in org/netbeans/modules/db/explorer/dlg/ConnectionDialog.java;
/cvs/db/src/org/netbeans/modules/db/explorer/dlg/ConnectionDialog.java,v  <-- 
ConnectionDialog.java
new revision: 1.11; previous revision: 1.10
done
RCS file:
/cvs/db/src/org/netbeans/modules/db/explorer/dlg/ConnectionDialogMediator.java,v
done
Checking in org/netbeans/modules/db/explorer/dlg/ConnectionDialogMediator.java;
/cvs/db/src/org/netbeans/modules/db/explorer/dlg/ConnectionDialogMediator.java,v
 <--  ConnectionDialogMediator.java
initial revision: 1.1
done
RCS file:
/cvs/db/src/org/netbeans/modules/db/explorer/dlg/ConnectionProgressListener.java,v
done
Checking in org/netbeans/modules/db/explorer/dlg/ConnectionProgressListener.java;
/cvs/db/src/org/netbeans/modules/db/explorer/dlg/ConnectionProgressListener.java,v
 <--  ConnectionProgressListener.javainitial revision: 1.1
done
Checking in org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.form;
/cvs/db/src/org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.form,v  <--
 NewConnectionPanel.form
new revision: 1.6; previous revision: 1.5
done
Checking in org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.java;
/cvs/db/src/org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.java,v  <--
 NewConnectionPanel.java
new revision: 1.15; previous revision: 1.14
done
Checking in org/netbeans/modules/db/explorer/dlg/SchemaPanel.form;
/cvs/db/src/org/netbeans/modules/db/explorer/dlg/SchemaPanel.form,v  <-- 
SchemaPanel.form
new revision: 1.5; previous revision: 1.4
done
Checking in org/netbeans/modules/db/explorer/dlg/SchemaPanel.java;
/cvs/db/src/org/netbeans/modules/db/explorer/dlg/SchemaPanel.java,v  <-- 
SchemaPanel.java
new revision: 1.14; previous revision: 1.13
done
Checking in org/netbeans/modules/db/resources/Bundle.properties;
/cvs/db/src/org/netbeans/modules/db/resources/Bundle.properties,v  <-- 
Bundle.properties
new revision: 1.98; previous revision: 1.97
done
Comment 17 Martin Schovanek 2005-11-18 20:38:57 UTC
VERIFIED