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 179094 - db connection for metadata is not restored after hibernate or suspend
Summary: db connection for metadata is not restored after hibernate or suspend
Status: REOPENED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0.1
Hardware: PC Windows 7 x64
: P4 normal with 2 votes (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-29 08:25 UTC by rptmaestro
Modified: 2013-08-01 12:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
error popup (26.39 KB, image/jpeg)
2009-12-29 08:25 UTC, rptmaestro
Details
messages.log (76.43 KB, application/octet-stream)
2009-12-29 08:27 UTC, rptmaestro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rptmaestro 2009-12-29 08:25:09 UTC
If I have a SQL command editor open in NetBeans before hibernating or sleeping my system, I always get an error after resuming the system and attempting to use code completion in the SQL editor. The message is:

    An error has occured while extracting the database metadata:
    org.netbeans.modules.db.metadata.model.api.MetadataException:
    java.sql.SQLException: Closed Connection

Reconnecting to the database from the services tab has no effect on restoring code completion or preventing this error from popping up every time I type any character that triggers code completion. (Shouldn't the same JDBC connection be used?) Only restarting the IDE resolves the problem and allows the connection to be restored.

My database connection is to an Oracle 10 database using oracle.jdbc.OracleDriver and a TNS/JDBC connection string.
Comment 1 rptmaestro 2009-12-29 08:25:51 UTC
Created attachment 92976 [details]
error popup
Comment 2 rptmaestro 2009-12-29 08:27:08 UTC
Created attachment 92977 [details]
messages.log
Comment 3 rptmaestro 2009-12-29 09:53:52 UTC
It seems this may not be restricted to resuming after hibernate or suspend. If the leave the SQL editor open for a while, the connection becomes invalid and this error occurs. Again, the only way to stop getting the error on code completion is by restarting NetBeans
Comment 4 Jiri Rechtacek 2010-04-14 13:13:52 UTC
Depends on admin properties on DB server which usually sets how long is a idle period. No plan to fix in IDE.
Comment 5 rptmaestro 2010-04-15 03:38:58 UTC
Perhaps I wasn't clear regarding this issue.

The problem is not that the database connection is timing out. The problem is that the SQL editor code completion feature does not get a new connection when it does time out, and the code completion feature remains broken until the IDE is restarted. Furthermore, typing any character that triggers code completion, such as '.', pops up an error alert which then hampers editing. This happens several times while editing a single SQL query and shows a distinct lack of polish in the SQL editor.

While I do not expect the IDE to override how the server times out database connections, I think it is reasonable to expect the following:

1) That the SQL editor should get a new connection when the connection that it has is no longer valid for the code completion operation being attempted.

2) The SQL editor should not bring up a modal error dialog every time it fails to perform code completion. In other words failing to perform code completion should not interrupt the developer as he is typing. A simple, standard notification in the status bar should be sufficient.
Comment 6 jclemens 2012-07-25 22:27:57 UTC
Further to rptmaestro's comment, the issue is that a single issue with throw repeated error messages for the same issue.  It basically renders the IDE unusable.

To stop getting the error messages, I have to delete the database connection from the Services tab.  No amount of Disconnect'ing and Reconnect'ing will stop the error from happening.

Deleting the database connection makes the IDE useable again but also obviously disables the intended functionality of the IDE.

I should note that this issue affects the code editor (where I experience the isses) in addition to the sql editor (where rptmaestro encounters it)