Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: truncate randomly failing
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 ...Received on Fri Dec 13 2002 - 02:29:19 CST
>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
>