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

Home -> Community -> Usenet -> c.d.o.tools -> Re: thow to resolve table locks

Re: thow to resolve table locks

From: Mark D Powell <markp7832_at_my-deja.com>
Date: Wed, 29 Nov 2000 14:49:41 GMT
Message-ID: <903522$ubb$1@nnrp1.deja.com>

In article <901p3q$tb4$1_at_nnrp1.deja.com>,   susana73_at_hotmail.com wrote:
> My application basically connects to the database 24 hours a day. It
> hangs several times a week due to table locks. The application is a
> mixture of many small queries/updates to individual rows. I have been
> reading the documentation but I can't find anything that can release
 the
> default locks. Anyone know how?
>
> Thanks.
>
> USERNAME SID TYPE OWNER OBJECT HELD REQUEST
> --------------- ----- ---- ---------- ------------ ----------- -------



> DBUSER 11 TX DBUSER EMP Exclusive None
> DBUSER 11 TX DB_OWNER EMP Exclusive None
> DBUSER 9 TX DBUSER EMP None Share
> DBUSER 9 TX DB_OWNER EMP None Share
>
>

To release the locks the locking session must commit or rollback. If the locking session is a run-a-way session you can use the alter system kill session 'sid, serial#' command to cancel them.

You can also consider modifying the application to make sure it commits at the end of each unit of work to reduce locking plus you may want to consider using pl/sql and the nowait option as in select for update nowait. If the row you are attempting to retrieve for update is locked the retrieving session will not wait when the nowait option is specified, but will return an error code letting your application know someone else has the desired row.

--
Mark D. Powell  -- The only advice that counts is the advice that
 you follow so follow your own advice --


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Nov 29 2000 - 08:49:41 CST

Original text of this message

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