Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 13th, 2009, 09:24 AM
stanley1610's Avatar
stanley1610 stanley1610 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 309 stanley1610 User rank is Sergeant (500 - 2000 Reputation Level)stanley1610 User rank is Sergeant (500 - 2000 Reputation Level)stanley1610 User rank is Sergeant (500 - 2000 Reputation Level)stanley1610 User rank is Sergeant (500 - 2000 Reputation Level)stanley1610 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 22 h 45 m 41 sec
Reputation Power: 15
Lock Tables

If the RDBMS is already ACID and SQL transaction has started,

WHAT SCENARIOS will cause us still to utilize LOCK tables to prevent from dirty data happening?

What is the typical technique to lock tables of typical RDBMS like DB2 and Oracle?

Please help. Thanks.
__________________
------------------------------------------
Perl Kids Kiss Perl
Stanley
------------------------------------------

Reply With Quote
  #2  
Old June 13th, 2009, 11:41 AM
shammat shammat is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 1,562 shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 49 m 34 sec
Reputation Power: 209
Quote:
Originally Posted by stanley1610
If the RDBMS is already ACID and SQL transaction has started,

WHAT SCENARIOS will cause us still to utilize LOCK tables to prevent from dirty data happening?

What is the typical technique to lock tables of typical RDBMS like DB2 and Oracle?

Please help. Thanks.
You should explain more detailed what you want to achieve.
What exactly do you mean with "dirty data"?

In Oracle for example you cannot prevent read access from a table by locking it.

Reply With Quote
  #3  
Old June 13th, 2009, 11:50 PM
stanley1610's Avatar
stanley1610 stanley1610 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 309 stanley1610 User rank is Sergeant (500 - 2000 Reputation Level)stanley1610 User rank is Sergeant (500 - 2000 Reputation Level)stanley1610 User rank is Sergeant (500 - 2000 Reputation Level)stanley1610 User rank is Sergeant (500 - 2000 Reputation Level)stanley1610 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 22 h 45 m 41 sec
Reputation Power: 15
Question

Actually that was the question by an interviewer.

He was surprised that I did NOT LOCK tables by RDBMS specific commands (with SQL statements) for transactions of multiple user access. He said that if the tables were NOT LOCKed, multiple user access (insert, update, delete) will cause records wrong and inconsistent and contradicted or it is called as dirty data.

I replied that any database supporting ACID and Transactions should prevent from dirty data. For example in ORACLE,

Code:
SET AUTOCOMMIT OFF
insert into RT values (1, 2);
rollback;
insert into RT values (3, 4);
commit;


or T-SQL:
Code:
DECLARE @TranName VARCHAR(20)
SELECT @TranName = 'MyTransaction'
BEGIN TRANSACTION @TranName
GO
USE pubs
GO
UPDATE roysched
SET royalty = royalty * 1.10
WHERE title_id LIKE 'Pc%'
GO
COMMIT TRANSACTION MyTransaction
GO


I don't know what scenario will cause explicitly LOCKing TABLE to become a MUST in ACID.

If there is really such scenario, should we call program commands (e.g. JTS, JTA or else in JAVA) or DB specific commands (say Oracle, SQL Server, DB2)?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Lock Tables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek