|
RE: Oracle error - "Stream has already been closed": msg#00061java.enhydra.general
I'm not sure if it's the same for Oracle but in PostgreSQL, when you get binary data you have to make sure that you set auto commit to false. So, before you execute your query, try conn.setAutoCommit( false ); > -----Original Message----- > From: enhydra-admin@xxxxxxxxxxx > [mailto:enhydra-admin@xxxxxxxxxxx] On Behalf Of > Seenivasan.Chandrasekararaja@xxxxxxx > Sent: Thursday, February 13, 2003 3:11 PM > To: enhydra@xxxxxxxxxxx > Subject: Enhydra: Oracle error - "Stream has already been closed" > > > > Friends, > > I got your mail id from the mailing list and I understood > that you have experienced the below error.. > > I am getting this error from a table that has a LONG RAW > column. In the select statement I have put 'LONG RAW' Column > first and in the rs.next(), I am retrieving the LONG RAW > column first. But even then I am getting this error. Do u > have any idea? > > > Below is a sample code I am using... > > > selProcess = conn.prepareStatement ("select data(this is > Long raw column), intername, transid, transorder, errorcount, > emailsent from max_interdata order by transid, transorder, rowstamp"); > > ResultSet rsetMax = selProcess.executeQuery(); > > try > { > while (rsetMax.next()) > { > > //08/15/02, JB -- using > getBinaryStream() instead of getBytes() to > //work around Oracle driver bug > InputStream inputStream = null; > try > { > inputStream = rsetMax.getBinaryStream(1); > data = readBinaryData(inputStream); > // method to convert the inputsream to my object > interfaceName = rsetMax.getString(2); > transID = rsetMax.getLong(3); > transOrder = rsetMax.getLong(4); > errorCount = rsetMax.getInt(5); > emailSent = rsetMax.getString(6); > } > > > > > > 000. 000: String.java.lang.String:Stack trace: > java.sql.SQLException: Stream has already been closed > at > oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180) > at > oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222) > at > oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285) > at > oracle.jdbc.dbaccess.DBDataSetImpl.getStreamItem(DBDataSetImpl > .java:1145) > at > oracle.jdbc.driver.OracleStatement.getBinaryStreamValue(Oracle > Statement.java:4616) > at > oracle.jdbc.driver.OracleResultSetImpl.getBinaryStream(OracleR > esultSetImpl.java:398) > at > psdi.iface.interdata.MaxInterDataBatch.processInterData(MaxInt > erDataBatch.java:150) > at > psdi.iface.mic.MicService$PollMaxInterdataBatch.run(MicService > .java:1723) > at java.lang.Thread.run(Thread.java:484) > > > Thanks & Regards, > > Seenivasan Chandrasekararaja. > > > > _______________________________________________ > Enhydra mailing list > Enhydra@xxxxxxxxxxx > http://www.enhydra.org/mailman/listinfo.cgi/en> hydra >
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Oracle error - "Stream has already been closed", Seenivasan . Chandrasekararaja |
|---|---|
| Next by Date: | how to refresh the connection pool programmingly?, linuxman |
| Previous by Thread: | Oracle error - "Stream has already been closed", Seenivasan . Chandrasekararaja |
| Next by Thread: | how to refresh the connection pool programmingly?, linuxman |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |