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 55410 - User not sufficiently notified that DB connection closed
Summary: User not sufficiently notified that DB connection closed
Status: CLOSED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords: USABILITY
Depends on:
Blocks:
 
Reported: 2005-02-23 12:32 UTC by Antonin Nebuzelsky
Modified: 2006-03-24 13:16 UTC (History)
0 users

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 Antonin Nebuzelsky 2005-02-23 12:32:27 UTC
1) Connect to a DB server with DB explorer in
Runtime tab
2) expand some nodes of the DB connection, execute
some queries, invoke View Data action ,...
(everything works)
3) shutdown the DB server
4) continue to work with the active DB connection
in Runtime tab
Now if you expand a table node in the connection
or if you invoke View Data on the table, you don't
get any message that the connection is not active,
but the actions don't work as expected. Unless you
look into java console of Netbeans where the
following exception appears

java.sql.SQLException: No operations allowed after
connection closed

you don't have a clue that the connection is inactive.
Comment 1 Radko Najman 2005-02-24 11:39:56 UTC
There is no acceptable way how to be informed if the connection is
active or not. It would be possible to send every few seconds a
request to the database if it is alive or not but it seems to me as
bad solution from performance point of view. The communication with
the database is influenced by network, database loading, etc. It means
that if there is a temporary network problem or the database is
overloaded by another operation, the response to our question can be
slow or it can be timeouted. How should we deal with that (we don't
know at this moment if it is alive or not)?
The other problem is that each driver vender provides its own error
messages. So "java.sql.SQLException: No operations allowed after
connection closed" id provided by one driver and another driver will
show different message. We are not able to understand what is the
problem from SQLException.

From my point of view the described usecase is not common. The
database is usually running on independent server and database
developer normally doesn't stop it as described.

Closing as WONTFIX.
Comment 2 Antonin Nebuzelsky 2005-02-24 12:31:42 UTC
Why don't you simply display the message of the exception to the user?
For example like

JDBC driver message: No operations allowed after connection closed
Comment 3 zikmund 2005-07-12 16:09:37 UTC
It seems reasonable. Andrei, could you please look at it?
Comment 4 Andrei Badea 2005-07-13 12:58:49 UTC
Yes, this approach sounds reasonable and seems already used almost everywhere
(for example when using the View Data action or adding database elements). The
only place where I don't get a message is the tree of database elements (when
you refresh a node or expand it for the first time). 

Checking in libsrc/org/netbeans/lib/ddl/impl/DriverSpecification.java;
/cvs/db/libsrc/org/netbeans/lib/ddl/impl/DriverSpecification.java,v  <-- 
DriverSpecification.java
new revision: 1.19; previous revision: 1.18
done
Checking in src/org/netbeans/modules/db/explorer/DatabaseNodeChildren.java;
/cvs/db/src/org/netbeans/modules/db/explorer/DatabaseNodeChildren.java,v  <-- 
DatabaseNodeChildren.java
new revision: 1.38; previous revision: 1.37
done
Checking in src/org/netbeans/modules/db/explorer/actions/RefreshChildrenAction.java;
/cvs/db/src/org/netbeans/modules/db/explorer/actions/RefreshChildrenAction.java,v
 <--  RefreshChildrenAction.java
new revision: 1.15; previous revision: 1.14
done
Checking in src/org/netbeans/modules/db/resources/Bundle.properties;
/cvs/db/src/org/netbeans/modules/db/resources/Bundle.properties,v  <-- 
Bundle.properties
new revision: 1.93; previous revision: 1.92
done
Comment 5 Antonin Nebuzelsky 2005-07-14 12:35:52 UTC
Looks good. Thanks.