This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

BLOB insertion into the database hangs

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to insert BLOB data > 4k into the database. I am using the package oracle.sql.blob.
We are using classes12.jar for the drivers.

Attached is the snippet of the code:



The above worked fine on WAS 5.1 with JDK 1.4.2 and classes12.zip. The oracle version being used is 10g
However we recently migrated to WAS 6.1. The JDK version being used is 1.5.1 and the driver calsses were replaced from classwes 12.zip to classes12.jar whcih is compatible with Oracle 10g
The database version is the same
However we observe that under load conditions, the query where we are inserting the empty blob takes an awfully long time and sometimes the session even hangs.
The method BLOB.empty_blob() is deprecated in the new calsses12.jar and so is the method getBinaryOutputStream().
Can this be cause of these delayed performance?

What methods can be used insted of the deprecated ones? (Java doc for Oracle.sql is not very exhausitve)

Can we use ojdbc.jar to get rid of this issue?

Kindly advise.

Thanks & regards,
Anup
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


We are using classes12.jar for the drivers.


Why? Are you using JDK 1.3 or lower? If not I'd upgrade to the latest driver your environment will support (see the Oracle JDBC page for info).
 
Anup Bansal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have upgraded the driver to Ojdbc14.jar but still facing the same issue
Any ideas??
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is because below select statement might be returning multiple results. I have seen this happening and by making sure that the select query returns only single result, hanging of executeQuery will not happen

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if this may help, but I personally don't ever use one database connection to execute more than one query at a time. Consider the following code:



By the time that the Statement stmt2 is created, stmt, the Connection connection may be still be in use by stmt, especially if the select-statement returned more than one row.
As a rule of thumb, I always make the inner SQL-statement run on a separate database connection, as in:



Try it.
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic