190 likes | 256 Views
Last Covered (almost). Variety of middleware mechanisms Gain? Enable n-tier architectures while not necessarily using a browser and all that accompanies a distributed structure. Can you answer?. How are object-based MW different from message-based MW?
E N D
Last Covered (almost) • Variety of middleware mechanisms Gain? Enable n-tier architectures while not necessarily using a browser and all that accompanies a distributed structure CIS 340
Can you answer? How are object-based MW different from message-based MW? How is a “monitor” different from a “broker” system? CIS 340
Topics • To understand ACID as defining database needs of an operating system • To understand the operating system • Basic responsibilities • Standard enhancements • Distributed processing support CIS 340
Def: ACIDS: ACID + Serializability • The assurance governing concurrent execution Goal: Several transactions occurring yield consistent results ANSI standard specification: A transaction sequence continues from beginning to end -- through all succeeding SQL statements – until: • COMMIT statement is reached • ROLLBACK statement is reached • End of program is reached • Program is abnormally terminated CIS 340
Data management (concept) • Commit -making a set of tentative changes permanent • Rollback - an operation which returns the database to some previous state. • Rollbacks are important for database integrity, because they mean that the database can be restored to a clean copy even after erroneous operations are performed • Integrity • Entity integrity concerns the concept of a primary key. Entity integrity is an integrity rule which states that every table must have a primary key and that the column or columns chosen to be the primary key should be unique and not null. • Referential integrity concerns the concept of a foreign key. • no child record can exist without a parent CIS 340
Classic Problems for Shared DBs Data integrity and consistency problems • Lost updates • Uncommitted data • Inconsistent retrievals CIS 340
Problematic Execution Lost Updates Normal Execution: T1: PRO_QOH=PRO_QOH+100, T2: PRO_QOH=PRO_QOH-30 CIS 340
Data Never Reached Commit, But Still Appears Uncommitted Data Correct Execution of Two Transactions T1: PRO_QOH=PRO_QOH+100 (Rollback), T2: PRO_QOH=PRO_QOH-30 CIS 340
Data Entry Correction Inconsistent Retrievals Valid Retrieval During Update: T2: correction of typing error 10 units CIS 340
Can READS ever get wrong values? Inconsistent with circumstances? Inconsistent Retrievals
The “Scheduler” • Utility of DBMS • Establishes order of operations among concurrent transaction How? • Interleaves execution Uses concurrency control algorithms • Ensures serializability • Ensures isolation of transactions Goal: So two transactions do not update same data element at same time CIS 340
The “Scheduler”: Read/Write Conflict Matrix • No problem if T1 and T2 access unrelated data • Possible confliction: • Access same data • At least one of them is a Write operation CIS 340
Lock Excludes use of a data item Required Prevent reading inconsistent data Lock Manager Assigns & polices locks Lock Granularity Level of lock use Database Table Page Row Field Enables different degrees of speed to the concurrency Def: Concurrency Control: Locking CIS 340
CLIENT CLIENT Transactional Properties: ACID Test A tomicity: If several components must come together for a process, then each atomic process operates correctly or entire combination aborts C onsistency: A service is correct when executed in its entirety and false or incorrect data is not introduced into the component databases I solation: If several clients request the same service at the same time and access the same data, the overall result will be as if they were alone – isolated -- in the system D urability: Completed transactions are complete and durable (have duration?) If necessary, redoing and undoing of changes in case of failures can occur services transactional coordination user program SERVER TP-Monitor Application 1 Application 2 Application 3 CIS 340
Simple Batch Systems “Monitors” • Software • Controlled sequence of events • Program branches back to monitor when finished Job Control Language (JCL) • Special type of programming language • Provides instruction to the monitor • What compiler to use? • What data to use? CIS 340
Time Sharing • Uses multiprogramming to handle multiple interactive jobs • Processor’s time is shared among multiple users • Multiple users simultaneously access the system through terminals CIS 340