Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How cancel query through JDBC?

Re: How cancel query through JDBC?

From: Don Seiler <don.seiler_at_cellcom.com>
Date: Thu, 31 Jul 2003 11:41:07 -0500
Message-Id: <pan.2003.07.31.16.15.12.587598@cellcom.com>


I have pretty much the exact same question. Although the problem is that I have update queries that are waiting indefinitely on tables or rows that are locked by another application. I tried java.sql.Statement.setQueryTimeout(x) but it didn't timeout. I've now read that setQueryTimeout won't detect a problem in my instance.

I need a way to automatically have my update query be automatically timed out instead of waiting forever.

Are you sure this isn't possible?

Don.

On Wed, 30 Jul 2003 20:23:45 +0200, Sybrand Bakker wrote:

> On Wed, 30 Jul 2003 18:08:41 GMT, "Randy Nichols"
> <randynichols_at_yahoo.com> wrote:
>

>>Pardon if this is a repeat.  I never saw answer to previous post.
>>
>>Is there a way to abort an Oracle 8i, 9 query that has been initiated via
>>JDBC (for instance, if it is running too long)?
>>
>>-Randy Nichols
>>

>
> No, there isn't directly.
> You can kill your query from a different session by issuing
> alter system kill session '<sid>,<serial#>', which you'll need to
> determine first of course from v$session.
> You can configure *profiles* to make sure your session is killed
> automatically when you reach a certain limit,
> and you can use resource manager to limit the resources your process
> is using.
> But above all you would be recommended to write efficient queries.
>
>
> Sybrand Bakker, Senior Oracle DBA
>
> To reply remove -verwijderdit from my e-mail address
Received on Thu Jul 31 2003 - 11:41:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US