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: Lock Table

Re: Lock Table

From: HansF <News.Hans_at_telus.net>
Date: Thu, 08 Sep 2005 14:40:20 GMT
Message-Id: <pan.2005.09.08.14.44.43.194209@telus.net>


On Thu, 08 Sep 2005 22:40:41 +1200, Iain William Wiseman interested us by writing:

> sybrandb_at_yahoo.com wrote:

>> If you require Oracle to behave like Sqlserver, you would better switch
>> to Sqlserver.
>> In Oracle it simply isn't possible to fully lock out readers.
>> 

>
> So how can I test the unavailability of a table in an application? We
> want to make sure the whole thing does not go belly up when table is not
> there
>

Why would

SELECT COUNT(*) FROM USER_TABLES WHERE TABLE_NAME='xyz';

not work for you? Per your 'requirement', this would check whether the table exists and never fail as long as you have an Oracle database connection. You could then make a decision based on the existance of the table.

Manually managing locks is generally a bad thing to do in Oracle, especially if you come from another RDBMS. You will be using incorrect 'habits' and will likely defeat Oracle's built in scalability and possibly security. Recommend you read Tom Kyte's "Effective Oracle by Design" book for more on this.

-- 
Hans Forbrich                           
Canada-wide Oracle training and consulting
mailto: Fuzzy.GreyBeard_at_gmail.com   
*** I no longer assist with top-posted newsgroup queries ***
Received on Thu Sep 08 2005 - 09:40:20 CDT

Original text of this message

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