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: Delete of child-entry locks father-table

Re: Delete of child-entry locks father-table

From: <hasta_l3_at_hotmail.com>
Date: 3 Dec 2006 09:23:53 -0800
Message-ID: <1165166632.964466.50730@73g2000cwn.googlegroups.com>

Charles Hooper wrote :
>
> In the code, you wrote:
> LOCK TABLE TEST_CONFIG IN EXCLUSIVE MODE NOWAIT;
>
> Then:
> SELECT description, username
> FROM TEST_CONFIG
> WHERE VALIDFROM IS NULL;
>
> Why are you locking the full table? If you remove the full table lock
> and the SELECT, then replace the SELECT with this, would it achieve the
> desired results?
> SELECT description, username
> FROM TEST_CONFIG
> WHERE VALIDFROM IS NULL
> FOR UPDATE;
>

Without the LOCK TABLE, phantom reads may very well kill his code ....

> SELECT description, username FROM TEST_CONFIG
> WHERE VALIDFROM IS NULL;
...

> UPDATE TEST_CONFIG
> SET VALIDFROM = validfromdate
> WHERE VALIDFROM IS NULL;
(not saying that I like LOCK TABLE :-) Received on Sun Dec 03 2006 - 11:23:53 CST

Original text of this message

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