1<!--$Id: term.so,v 10.19 2005/09/23 16:26:40 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB Reference Guide: Terminology</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Berkeley DB Transactional Data Store Applications</dl></b></td> 13<td align=right><a href="../transapp/why.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../transapp/fail.html"><img src="../../images/next.gif" alt="Next"></a> 14</td></tr></table> 15<p align=center><b>Terminology</b></p> 16<p>Here are some definitions that will be helpful in understanding 17transactions:</p> 18<br> 19<b>Thread of control</b><ul compact><li>Berkeley DB is indifferent to the type or style of threads being used by the 20application; or, for that matter, if threads are being used at all -- 21because Berkeley DB supports multiprocess access. In the Berkeley DB documentation, 22any time we refer to a <i>thread of control</i>, it can be read as 23a true thread (one of many in an application's address space) or a 24process.</ul> 25<b>Free-threaded</b><ul compact><li>A Berkeley DB handle that can be used by multiple threads simultaneously 26without any application-level synchronization is called 27<i>free-threaded</i>.</ul> 28<b>Transaction</b><ul compact><li>A <i>transaction</i> is a one or more operations on one or more 29databases that should be treated as a single unit of work. For example, 30changes to a set of databases, in which either all of the changes must be 31applied to the database(s) or none of them should. Applications specify 32when each transaction starts, what database operations are included in 33it, and when it ends.</ul> 34<b>Transaction abort/commit</b><ul compact><li>Every transaction ends by <i>committing</i> or <i>aborting</i>. 35If a transaction commits, Berkeley DB guarantees that any database changes 36included in the transaction will never be lost, even after system or 37application failure. If a transaction aborts, or is uncommitted when 38the system or application fails, then the changes involved will never 39appear in the database.</ul> 40<b>System or application failure</b><ul compact><li><i>System or application failure</i> is the phrase we use to 41describe something bad happening near your data. It can be an 42application dumping core, being interrupted by a signal, the disk 43filling up, or the entire system crashing. In any case, for whatever 44reason, the application can no longer make forward progress, and its 45databases are left in an unknown state.</ul> 46<b>Recovery</b><ul compact><li><i>Recovery</i> is what makes the database consistent after a system 47or application failure. The recovery process includes review of log 48files and databases to ensure that the changes from each committed 49transaction appear in the database, and that no changes from an 50unfinished (or aborted) transaction do. Whenever system or application 51failure occurs, applications must usually run recovery.</ul> 52<b>Deadlock</b><ul compact><li><i>Deadlock</i>, in its simplest form, happens when one thread of 53control owns resource A, but needs resource B; while another thread of 54control owns resource B, but needs resource A. Neither thread of 55control can make progress, and so one has to give up and release all 56its resources, at which time the remaining thread of control can make 57forward progress.</ul> 58<br> 59<table width="100%"><tr><td><br></td><td align=right><a href="../transapp/why.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../transapp/fail.html"><img src="../../images/next.gif" alt="Next"></a> 60</td></tr></table> 61<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 62</body> 63</html> 64