Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help Urgently  RSS feed

Himanshu Jhamb
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All.
I am having a very strange problem. Let me get to it right away.
We are using Weblogic 6.0 running on a Linux box with Oracle 8.1.6 as the DB.
One of the tables has 2 blob fields where we store 2 blobs per request. These two fields are in XML format in the application realm. We use the following method in a preparedStatement for storing the blobs in the DB.
public void setBinaryStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
We use a ByteArrayInputStream for the parameter 'x' above.
Now this is what is happening...
I convert the XML into a ByteArrayInputStream, put it in a preparedStatement with the above method & call the executeUpdate method on it.
When I look retrieve this inserted row, I get back the XML I inserted with 3 fields missing. These three fields are present somewhere in the middle of the XML when I insert it.
What puzzles me more is that this does not happen all the time. Sometimes the retrieval retrieves the complete Blob just fine.
Just to be sure that it is indeed the insertion that is the problem, I do a dbms_lob.getlength(Blob column) & the length of the blob stored in the DB is less than the one I inserted. That proves that the insert is not inserting the data properly & something flaky is happening at the time of the insert.
Any ideas as why this is happening?? Is there a problem with the setBinaryStream( ) method ??? Any suggestions are more than welcome as this has got me completely stumped !
I would appreciate a quick response as this is quite an urgent piece in my app & I need a solution ASAP.
Thanks in advance.
- Himanshu
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!