This website uses cookies to ensure you have the best experience. Learn more

Sql Locks Essay

686 words - 3 pages

This assignment verifies that you understand how shared and exclusive locks work. Suppose that S1, S2, and S3 are sessions connected concurrently to the same database instance. Suppose further that D1, D2, and D3 are data objects that can be locked with a shared and exclusive lock. For the ten locking situations below, indicate, for each session, whether it procures the requested lock, waits, or deadlocks.

S1 has a shared lock on D1 and S2 attempts to procure a shared lock on D1.
Since s1 has a shared lock on D1 and the other sessions can procure the lock without any waiting for release by s1.so s2 can procure a shared lock on D1
*
S1 has an exclusive lock on D1 and S2 attempts to procure a shared lock on D1.
* Since S1 has a exclusive lock on D1 any other sessions cannot procure a shared lock on D1.The other sessions has to wait till S1 ...view middle of the document...

so S2 must wait to begin until S1 commits in order to procure an exclusive lock on D1

S1 has a shared lock on D1, S2 has a shared lock on D1, and S3 attempts to procure a shared lock on D1.
* Since shared locks can be procured even when other sessions have made shared locks on the same data instance.A data instance can be accessed by any no of database
S3 can procure a shared lock on D1.
S1 has an exclusive lock on D1 and a shared lock on D2, and S2 attempts to procure an exclusive lock on D2.
* Since exclusive locks can be made if no other sessions have made any kind of locks on the same data object,S2 must wait until S1 unlocks D2 in order to procure an exclusive lock on D2.

S1 has a shared lock on D1 and a shared lock on D2, and S2 attempts to procure a shared lock on D2.
* Since shared locks can be made even when any no of sessions access the same data object,
* S2 can procure a shared lock on D2.

S1 has a shared lock on D1 and a shared lock on D2. S2 has a shared lock on D2 and attempts to procure an exclusive lock on D1.
* Since D1 is locked by S1 for a shared lock S2 must wait until S1 unlocks D1in order to procure an exclusive lock on D1
*
S1 has an exclusive lock on D1 and is waiting for an exclusive lock on D2. S2 has an exclusive lock on D2 and is waiting for an exclusive lock on D1.
* Since s1 is waiting for data object D2 which is locked exclusively by s2 and s2 is waiting for data object d1 which is locked exclusively by D1, this situation leads to a deadlock.
*

S1 has an exclusive lock on D1 and is waiting for an exclusive lock on D2. S2 has an exclusive lock on D2 and is waiting for an exclusive lock on D3. S3 has an exclusive lock on D3 and is waiting for an exclusive lock on D1.
* Since s1 is waiting for data object D2 which is locked exclusively by s2 and s2 is waiting for data object D3 which is locked exclusively by D3 and s3 is waiting for a instance d1 which is locked exclusively by s1 this situation leads to a deadlock.

Other Papers Like Sql Locks

Difference Between Truncate and Delete Essay

3178 words - 13 pages 1. What is different between TRUNCATE and DELETE? The Delete command will log the data changes in the log file where as the truncate will simply remove the data without it. Hence Data removed by Delete command can be rolled back but not the data removed by TRUNCATE. Truncate is a DDL statement whereas DELETE is a DML statement. 2. What are ORACLE PRECOMPILERS? A precompiler is a tool that allows programmers to embed SQL statements in

Asignment Essay

3234 words - 13 pages Features Automatic Locking Oracle locking is performed automatically and requires no user action. Implicit locking occurs for SQL statements as necessary, depending on the action requested. Oracle’s lock manager automatically locks table data at the row level. By locking table data at the row level, contention for the same data is minimized. Oracle’s lock manager maintains several different types of row locks, depending on what type of operation

Databases: Identifying Index Placement

2234 words - 9 pages SQL join is performed using a foreign key that has no index. The focus of this assignment is not locking, so I will not get into fine details, but suffice it to say that page-level locks are always bad for transactions because they result in deadlocks over which the database developer has no control. Another reason we index all foreign key columns is because the vast majority of the time, the foreign key will be used in the WHERE clause of SQL

Mobile Database

4949 words - 20 pages gets a stable connection with the fixed server. The main idea is to associate each LDT with a contract. Intuitively, a contract can be seen as a set of rules that guarantee a successful global commit if satisfied. This idea generalizes the notions found in [WaC99]. A contract defines each partner engagement regarding isolation: access intentions, locks, timeouts for locks, divergence limit for shared copies, etc. It is established

Client Server

2071 words - 9 pages High-performance File System The file system must support multiple tasks and provide the locks that protect integrity of the data. Server programs typically work on many files without too much deterioration in performance. 9. Efficient memory management The memory system must be efficient to support very large programs and very large data objects. 10. Dynamically Linked Run-Time Extensions The OS services should be extendable. The

Riordan Security Assessment Week 5

3471 words - 14 pages . Physical security considerations include: * personnel safety * access controls mechanisms such as locks, keys, card access systems * monitoring and detection systems like closed circuit TV, security guards, and guard dogs * intrusions detection for sensitive areas * personnel security policy awareness The K.E.A.R. team external physical assessment began upon our arrival at the headquarters office. We arrived at the main

Principles Of Information Security

3291 words - 14 pages information from the system. Physical security policies deal with hardware as a physical asset and with the protection of physical assets from harm or theft. Applying the traditional tools of physical security, such as locks and keys, restricts access to and interaction with the hardware components of an information system. Securing the physical location of computers and the computers themselves is important because a breach of physical security

Principles of Information Security

3241 words - 13 pages . Physical security policies deal with hardware as a physical asset and with the protection of physical assets from harm or theft. Applying the traditional tools of physical security, such as locks and keys, restricts access to and interaction with the hardware components of an information system. Securing the physical location of computers and the computers themselves is important because a breach of physical security can result in a loss of

Computer System Security

3291 words - 14 pages information from the system. Physical security policies deal with hardware as a physical asset and with the protection of physical assets from harm or theft. Applying the traditional tools of physical security, such as locks and keys, restricts access to and interaction with the hardware components of an information system. Securing the physical location of computers and the computers themselves is important because a breach of physical security

Freedom And Responsibility

2141 words - 9 pages Built within the Constitution of the United States are specifically defined freedoms that are guaranteed to all citizens. Conversely, with every constitutional freedom there comes a corresponding responsibility. On September 25, 1789, the state legislature’s twelve proposed amendments were transmitted by congress, the first two dealing with congressional representation and congressional pay. The following numbers three through twelve were

Hate Crime Laws

2348 words - 10 pages On June 7, 1998, 49-year-old James Byrd Jr. of Texas accepted a ride from three white men, who then beat him severely, urinated on him, chained him by his ankles to the back of their pick-up truck, dragged him for three miles into the countryside, and dumped his corpse in front of an African-American cemetery (Graczyk). A little over a year later, a jury sentenced ring leader John King to death by lethal injection (“Man Executed for Dragging

Related Essays

Cursors In Pl/Sql Essay

3048 words - 13 pages SQL Cursor  A SQL cursor is a private Oracle SQL working area. There are two types of SQL cursor: implicit or explicit cursor. The implicit cursor is used by Oracle server to test and parse the SQL statements and the explicit cursors are declared by the programmers. Using the implicit cursor, we can test the outcome of SQL statements in PL/SQL. For example, • SQL%ROWCOUNT, return the number of rows affected; • SQL%FOUND, a BOOLEAN

Computer Science Essay

684 words - 3 pages the previous lecture) same way when data at the conceptual level is correlated with the same data at the internal level, this is called the conceptual/Internal mapping. When you connect to SQL Server or SQL Azure, you need to specify a target database for migration. If you have multiple Access databases you can map them to multiple SQL Server databases (or schemas) or to multiple schemas under the

Test Essay

1262 words - 6 pages 1. (TCO A) A database stores (Points : 5) Ans: E 2. (TCO B) Entities of a given type are grouped into a(n) _____. (Points : 5) entity classes. 3. (TCO C) A determinant that determines all the other columns in a relation is a _____. (Points : 5) D) candidate key 4. (TCO C) A table that meets the definition of a relation is in _____ (Points : 5) A) First Normal Form 5. (TCO D) In a SQL query, which SQL keyword is used with

Transaction Management Ch 10 Essay

4346 words - 18 pages . | | | | | |serializability: The result of the concurrent execution of transactions is | | | | | |the same as though the transactions were executed in serial order. | Note that SQL provides transaction support through COMMIT (permanently saves changes to disk) and ROLLBACK (restores the previous database state) Each SQL transaction is composed of