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: truncate randomly failing

Re: truncate randomly failing

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 13 Dec 2002 08:29:19 -0000
Message-ID: <atc5q4$7ht$1$8302bc10@news.demon.co.uk>

Locking before truncating is not a solution. The truncate is preceded by an implicit commit, which releases the lock, so the truncate could still be blocked:

session 1:

    lock table t1 in exclusive mode

session 2:

    insert into t1 values('xxxx');

        starts to wait for session 1

session 1:

    truncate table t1;

        (session 2 gets the SX lock)
        ORA-00054 because of session 2


--
Regards

Jonathan Lewis
http://www.jlcomp.demon.co.uk

Next Seminar dates:
(see http://www.jlcomp.demon.co.uk/seminar.html )

____England______January 21/23


The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html





Matthias Rogel wrote in message ...

>Joel,
>
>I totally agree with you, I had similar ideas ...
>
>that's exactly why I suggested to *explicitly* lock the table before
>truncating it.
>
>I still think, this could be fixing it ...
>
>Matthias
>
Received on Fri Dec 13 2002 - 02:29:19 CST

Original text of this message

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