Part 1: Concurrency Issues in the Database
1. Considering that these various transactions use some of the same tables and fields in the database, explain why it is important for the changes made by each of these transactions to be atomic. (2 pts)
Answer: The necessity of an atomic transaction, in this case, is to maintain state consistency in the database system. Since various transactions require the use of the same fields/data within the database, a sequential update to each field (prioritized based on order of transactions conducted) could lead to an imbalance in the overall system. For example: assuming a few items are sold to a customer and the sales information is updated. There is a need for an immediate update to the “QuantityOnHand” field (a reduction, since a certain unit of items have been sold), along with an update to the “total sales”, “Profit” and other relevant fields. Also, atomic implementation of transactions allows for easy recall/rollback of temporary updates to fields during the “transaction processing period”. This ensures that the database is left unchanged in the case of a failed event in the transaction, which maintains correct state in the said database: if the customer’s card gets declined for example.
2. Describe a scenario in which an update of QuantityOnHand could be lost. (See the example in the textbook and apply it to Bev’s) (5 pts)
Answer: In the case of Bev’s store, the likelihood of concurrency in database update can exist when there is a re-stocking of the store due to the arrival of new items from vendors. It is expected of the store personnel to stock the items and run an “Item Quantity Received Transaction”, which updates the “QuantityOnHand” field. Since this transaction is independent of the sales transaction, which also updates the “QuantityOnHand” field, there lies a potential concurrency. If one of the items being stocked is a “hand crafted handbag”, and a sales transaction was initiated at the same time as an “Item Quantity Received Transaction” on 5 extra units of that bag. The likely consequence is that both the sales transaction and “Item Quantity Received Transaction” reads a copy of the “QuantityOnHand” field value, of the bag item, to temporary memory within their local function spheres. If sales transaction has priority (perhaps due to initiation at a slightly earlier instance than the Item Quantity Received Transaction), then the sales transaction decrements the “QuantityOnHand” field by the “input Quantity” value and updates the “QuantityOnHand” field accordingly. While the new value for “QuantityOnHand” has been decremented, the “Item Quantity Received Transaction” still operates on the earlier copied variable value of the “QuantityOnHand” and increments its value by 5! Upon update, the new “QuantityOnHand” will be more than its actual value by a factor of the “input Quantity value” i.e. it will not reflect the decrement due to sales.
3. Explain how locking could be used to prevent the lost update in your answer to Q2. (3 pts)
Answer: Resource locking disallows sharing of resource values that have been requested for update i.e. once one application has requested for an update on a field, it is temporarily made unavailable to other applications until the update is registered (as either failed or successful). This intuitively solves the problem identified in Q2, because resource locking would allow just one of the transactions access to the value of the “QuantityOnHand” field at a time. Hence, the sales transaction (which requested first) would have to finish its update on the “QuantityOnHand” i.e. decrement by the “input Quantity” value, before the “Item Quantity Received Transaction” can access the “QuantityOnHand” field (having reflected the decrement due to sales). When the “Item Quantity Received Transaction” increments the “QuantityOnHand” field by ‘5’, the value will be accurate.
4. Assume you are taking a “pessimistic” approach and lock entire tables needed for a transaction. You lock each table before you access it, and you don’t release all locks until the end of a transaction. Is it possible for deadlock to occur between two Sale Transactions? (2 pts) Why or why not? (2 pts)
Answer: Yes, it is possible for a deadlock to occur.
While a “pessimistic locking” strategy anticipates the possibility of a lock, there is going to be a deadlock in the implementation of locks for concurrent sales transactions if there is no specific order in which sales transactions obtain and release locks.
For example: say customer A orders for a product “Shirt” and after extra...
Database Security Plan and Requirements Definition for a University Department The database security plan and requirements definition were developed. The plan included, at the outset, the inclusion of major stakeholder at the University and described their roles in initiating, implementing, and maintaining the plan. Individuals responsible for daily and other periodic tasks were developed. A major consideration in planning the security was the policy that governs granting of access. The need-to-know,
Database Security The focus of this study is that of database security. Databases and database technology are such that play critical roles in the use of computers whether it be in business, electronic commerce, engineering, medicine, genetics, law, education or other such entities requiring the use of computer technology. A database is quite simply a collection of data that is related such as a database containing customer information, supplier information, employee
With optimistic concurrency control, the database checks resources to determine if any conflicts have occurred only when attempting to change data. If a conflict occurs, the application must read the data and attempt the change again. Pessimistic concurrency, on the other hand, control locks resources as they are required, for the duration of a transaction. Unless deadlocks occur, a transaction is assured of successful completion 5.5 Audit Tracking Although auditing does
Design criteria exist at the levels of the technical, system integration aspects of the database to other systems through XML. This integration is critically important to ensure that the applications created can be effectively used over time and not have any scalability issues. There is also the need for designing the databases at the presentation layer to provide for scalability and flexibility of being able to create applications relatively quickly
In addition to these two Director-level positions, the roles of the users of the databases and data mining applications also need to be taken into account. The sales, marketing, product management, product marketing, and services departments all need to have access to the databases and data mining applications. In addition, branch offices that access the company's applications over the shared T1 line will also need to have specific security
Security Policy: The information security environment is evolving because organizations of different sizes usually experience a steady stream of data security threats. Small and large business owners as well as IT managers are kept awake with various things like malware, hacking, botnets, and worms. These managers and business owners are usually concerned whether the network is safe and strong enough to repel attacks. Many organizations are plagued and tend to
Our semester plans gives you unlimited, unrestricted access to our entire library of resources —writing tools, guides, example essays, tutorials, class notes, and more.
Get Started Now