Optimistic concurrency control: Difference between revisions

Content deleted Content added
Reverting edit(s) by Embodimentgeniuslm3 (talk) to rev. 986772655 by Rublov: Vandalism (RW 16)
Monkbot (talk | contribs)
m Task 18 (cosmetic): eval 19 templates: hyphenate params (5×);
Line 1:
'''Optimistic concurrency control''' ('''OCC''') is a [[concurrency control]] method applied to transactional systems such as [[relational database management systems]] and [[software transactional memory]]. OCC assumes that multiple transactions can frequently complete without interfering with each other. While running, transactions use data resources without acquiring locks on those resources. Before committing, each transaction verifies that no other transaction has modified the data it has read. If the check reveals conflicting modifications, the committing transaction rolls back and can be restarted.<ref>{{cite book | title = Expert One-on-One J2EE Design and Development | first = Rohit | last = Johnson | publisher = Wrox Press | year = 2003 | isbn = 978-0-7645-4385-2 | chapter = Common Data Access Issues | chapterurlchapter-url = http://learning.infocollections.com/ebook%202/Computer/Programming/Java/Expert_One-on-One_J2EE_Design_and_Development/6266final/LiB0080.html | archive-url = https://web.archive.org/web/20111008203709/http://learning.infocollections.com/ebook%202/Computer/Programming/Java/Expert_One-on-One_J2EE_Design_and_Development/6266final/LiB0080.html | archive-date = 8 October 2011}}</ref> Optimistic concurrency control was first proposed by [[H. T. Kung]] and John T. Robinson.<ref name="KungRobinson1981">{{Cite news| title = On Optimistic Methods for Concurrency Control | first = J. T. Robinson | last = H. T. Kung | publisher = ACM Transactions on Database Systems | year = 1981 | url = https://apps.dtic.mil/dtic/tr/fulltext/u2/a081452.pdf}}</ref>
 
OCC is generally used in environments with low [[Block contention|data contention]]. When conflicts are rare, transactions can complete without the expense of managing locks and without having transactions wait for other transactions' locks to clear, leading to higher throughput than other concurrency control methods. However, if contention for data resources is frequent, the cost of repeatedly restarting transactions hurts performance significantly; it is commonly thought{{who|date=July 2016}} that other [[concurrency control]] methods have better performance under these conditions.{{citation needed|date=July 2016}} However, locking-based ("pessimistic") methods also can deliver poor performance because locking can drastically limit effective concurrency even when deadlocks are avoided.
Line 22:
* [[Bugzilla]] uses OCC; [[edit conflict]]s are called "mid-air collisions".<ref>{{cite web | url = https://wiki.mozilla.org/Bugzilla:FAQ#Does_Bugzilla_provide_record_locking_when_there_is_simultaneous_access_to_the_same_bug.3F_Does_the_second_person_get_a_notice_that_the_bug_is_in_use_or_how_are_they_notified.3F | title = Bugzilla: FAQ: Administrative Questions | work = MozillaWiki | date = 11 April 2012}}</ref>
* The [[Ruby on Rails]] framework has an API for OCC.<ref>{{cite web | url = http://api.rubyonrails.org/classes/ActiveRecord/Locking/Optimistic.html | title = Module ActiveRecord::Locking | work = Rails Framework Documentation}}</ref>
* The [[Grails (framework)|Grails]] framework uses OCC in its default conventions.<ref>{{cite web | url = http://grails.org/doc/1.0.x/guide/single.html#5.3.5%20Pessimistic%20and%20Optimistic%20Locking | title = Object Relational Mapping (GORM) | work = Grails Framework Documentation | url-status = dead | archiveurlarchive-url = https://web.archive.org/web/20140815173309/http://grails.org/doc/1.0.x/guide/single.html#5.3.5%20Pessimistic%20and%20Optimistic%20Locking | archivedatearchive-date = 2014-08-15 }}</ref>
* The [[GT.M]] database engine uses OCC for managing transactions<ref>{{cite web | url = http://tinco.pair.com/bhaskar/gtm/doc/books/pg/UNIX_manual/ch05s17.html | title = Transaction Processing | work = GT.M Programmers Guide UNIX Edition}}</ref> (even single updates are treated as mini-transactions).
* [[Microsoft]]'s [[Entity Framework]] (including Code-First) has built-in support for OCC based on a binary timestamp value.<ref>{{cite web | url = http://blogs.msdn.com/b/alexj/archive/2009/05/20/tip-19-how-to-use-optimistic-concurrency-in-the-entity-framework.aspx | title = Tip 19 – How to use Optimistic Concurrency with the Entity Framework | work = MSDN Blogs | date = 19 May 2009}}
Line 49:
*{{cite journal|title=On optimistic methods for concurrency control|journal=ACM Transactions on Database Systems|date=June 1981|first=H. T.|last=Kung|author2=John T. Robinson|volume=6|issue=2|pages=213–226|doi=10.1145/319566.319567|citeseerx=10.1.1.101.8988}}
* Enterprise JavaBeans, 3.0, By Bill Burke, Richard Monson-Haefel, Chapter 16. Transactions, Section 16.3.5. Optimistic Locking, Publisher: O'Reilly, Pub Date: May 16, 2006,Print {{ISBN|0-596-00978-X}},
* {{cite conference | first = Andreas | last = Hollmann | title = Multi-Isolation: Virtues and Limitations | booktitlebook-title = Multi-Isolation (what is between pessimistic and optimistic locking) | pages = 8 | publisher = Happy-Guys Software GbR | date = May 2009 | ___location = 01069 Gutzkovstr. 30/F301.2, Dresden | url = http://www.andrej-hollmann.de/images/stories/informatik/multi-isolation-part-1.pdf | format = [[PDF]] | accessdateaccess-date = 2013-05-16 }}{{dead link|date=March 2018 |bot=InternetArchiveBot |fix-attempted=yes }}
 
{{DEFAULTSORT:Optimistic Concurrency Control}}