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.
[ 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.
Created attachment 26187 [details] Thread dump from netbeans.
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.
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 ??
Created attachment 26282 [details] Log output
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).
Created attachment 26292 [details] DB Explorer module with logging
Created attachment 26293 [details] output with new datbase jar file.
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?
Created attachment 26306 [details] New DB Exp module
I've found the same results on a solaris-sparc machine that I'm working on. Can I test this out the same way?
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.
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?
Created attachment 26431 [details] Solaris-sparc output
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.
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.
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
VERIFIED