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 179959 - java.sql.SQLException: Stream has already been closed
Summary: java.sql.SQLException: Stream has already been closed
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-28 07:16 UTC by Eduardo.m Costa
Modified: 2012-05-10 09:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 145309


Attachments
stacktrace (1.40 KB, text/plain)
2010-01-28 07:16 UTC, Eduardo.m Costa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eduardo.m Costa 2010-01-28 07:16:12 UTC
Build: NetBeans IDE 6.8 (Build 200912041610)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_04-b12
OS: Windows XP

User Comments:
_m4c0_: I have an Oracle connection. The DBMS was configured to kill the connection after a 5 minutes timeout. Steps:

1. Connect to database at Services TC
2. Right click on database, "Execute command"
3. Executed some random SQL
4. Wait until timeout
5. Tryed to run more SQL (the exception was thrown)
6. Right click on database, "Disconnect"
7. Repeated 2 and 3 (the exception was thrown again - that's the one I'm reporting)




Stacktrace: 
java.sql.SQLException: Stream has already been closed
   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:190)
   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:286)
   at oracle.jdbc.driver.LongAccessor.getBytes(LongAccessor.java:212)
   at oracle.jdbc.driver.LongAccessor.getString(LongAccessor.java:281)
   at oracle.jdbc.driver.T4CLongAccessor.getString(T4CLongAccessor.java:426)
Comment 1 Eduardo.m Costa 2010-01-28 07:16:17 UTC
Created attachment 93629 [details]
stacktrace
Comment 2 lukeester 2010-04-01 16:26:12 UTC
I got this same exception when trying to execute a SELECT on a longvarchar type field (Oracle database)
Comment 3 Exceptions Reporter 2010-05-10 20:37:20 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=145309
Comment 4 Jaroslav Havlin 2012-04-27 10:17:22 UTC
The problem is probably caused by reading streamed values (e.g. LONG VARCHAR).
In the current implementation, these steps are made to read data:

1. Create a ResultSet for the specified query.
2. Inspect the ResultSet, read database metadata for contained columns.
3. Read values from the ResultSet.

In step 2, DatabaseMetaData.getPrimaryKeys is invoked, which closes streams in the result set, and therefore streamed values cannot be read in step 3.
Comment 5 Jaroslav Havlin 2012-05-09 10:02:48 UTC
http://hg.netbeans.org/core-main/rev/3e89be6d8ac3
Fixed.
Comment 6 Quality Engineering 2012-05-10 09:58:38 UTC
Integrated into 'main-golden', will be available in build *201205100400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3e89be6d8ac3
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #179959 - java.sql.SQLException: Stream has already been closed