Re: JDK Hang due to SQL Query

From: <b_arlt_at_my-deja.com>
Date: Wed, 17 Jan 2001 04:39:44 GMT
Message-ID: <9437mg$304$1_at_nnrp1.deja.com>


In article <3a4dff07$1_at_news.starhub.net.sg>,   "Adrian Ting" <adrianting_at_post1.com> wrote:
> Hi, i am facing a major problem in my current
 development.
>
> When I send a SQL query (through servlets) to
 Oracle8i via the Oracle thin
> driver, it always seem to hang my JDK with one
 set of SQL statement --
> particularly
>
> DELETE FROM table_name WHERE table_id='xxx'
>
> This statement has been tested through both a
 regular
> statement.executeUpdate() as well as a
 preparedstatement.executeUpdate() and
> yields similar results. However, this does not
 occur for all tables,
> particularly only tables with quite a number of
 fields.
>
> My development configuration:
> Apache Webserver 1.3.14
> Apache JServ 1.1.2-2
> JDK1.3
> JSDK2.0
> Oracle8i v.8.1.6
>
> Anybody has faced similar problem before and
 has a solution? Heard its a bug
> in JDK1.3 about statements with the 'WHERE'
 condition. At my wits end now.
>
>

This does sound like an potential performance problem on a large delete. If you do determine that this is not a performance issue, and you can trace the "hang" to a JDK problem, wrap the delete statement within a stored procedure. This will avoid the reference to where in the java.sql.Statement.

CREATE OR REPLACE PROCEDURE
FOO
( tid integer )
as
begin
  delete from table_name where table_id = tid; end;

Hope this helps...

-Brian

Sent via Deja.com
http://www.deja.com/ Received on Wed Jan 17 2001 - 05:39:44 CET

Original text of this message