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 112788 - Create Database action should wait till DB starts
Summary: Create Database action should wait till DB starts
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Derby (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords: T9Y
: 113815 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-14 18:00 UTC by Martin Schovanek
Modified: 2009-10-19 21:51 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
java.net.ConnectException: Connection refused (2.10 KB, text/plain)
2007-08-14 18:01 UTC, Martin Schovanek
Details
stacktrace (4.01 KB, text/plain)
2007-09-20 10:23 UTC, Radim Roska
Details
stacktrace (5.11 KB, text/plain)
2009-10-19 21:51 UTC, neilg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Schovanek 2007-08-14 18:00:10 UTC
[#2007081300, jdk1.5.0]


to reproduce:
-------------
1) stop Derby if running
2) invoke Tools > Java DB Database > Create Database...
3) enter Database Name
4) click OK
ERROR: IDE  throws:
Comment 1 Martin Schovanek 2007-08-14 18:01:19 UTC
Created attachment 46594 [details]
java.net.ConnectException: Connection refused
Comment 2 Andrei Badea 2007-08-28 15:24:52 UTC
Right, it should wait. But note that after 5 seconds it will display a dialog asking the user whether to wait more (as
it currently does when starting the server while making a connection from the Runtime tab). Will this play nicely with
the T9Y keyword? If not, perhaps I could provide a method to start the database in tests, which would display no dialogs
and which the test would call before creating a database.
Comment 3 Andrei Badea 2007-08-29 17:58:39 UTC
*** Issue 113815 has been marked as a duplicate of this issue. ***
Comment 4 Martin Schovanek 2007-09-05 09:57:08 UTC
We are solving similar problem in automated tests, a method like: DerbyRegistry.getDefault().isStarted(); which will
return true only if the database is running and ready to accept connections, would come in useful.
Comment 5 Radim Roska 2007-09-20 10:23:06 UTC
Build: NetBeans IDE Dev (Build 200709200000)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b02
OS: Linux, 2.6.20-16-generic, i386

User Comments: 
if derby is not running and i want to create database ( in tools ->...), warning window appears telling server is not listening on port 1527 (thats true)...but exception i would not expect.

And of course in this case i would expect that server will start and after that db will be created.
Comment 6 Radim Roska 2007-09-20 10:23:24 UTC
Created attachment 49138 [details]
stacktrace
Comment 7 Andrei Badea 2007-10-31 18:09:56 UTC
Fixed.

Checking in src/org/netbeans/modules/derby/RegisterDerby.java;
/cvs/db/derby/src/org/netbeans/modules/derby/RegisterDerby.java,v  <--  RegisterDerby.java
new revision: 1.31; previous revision: 1.30
done
Checking in src/org/netbeans/modules/derby/api/DerbyDatabases.java;
/cvs/db/derby/src/org/netbeans/modules/derby/api/DerbyDatabases.java,v  <--  DerbyDatabases.java
new revision: 1.7; previous revision: 1.6
done
Comment 8 neilg 2009-10-19 21:51:11 UTC
Build: NetBeans IDE Dev (Build 200910170201)
VM: Java HotSpot(TM) 64-Bit Server VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Linux, 2.6.28-15-generic, amd64

User Comments: 


Stacktrace: 
java.net.ConnectException: Connection timed out
        at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:0)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:525)
Comment 9 neilg 2009-10-19 21:51:15 UTC
Created attachment 89712 [details]
stacktrace