Import BSDDB 4.7.25 (as of svn r89086)

This commit is contained in:
Zachary Ware
2017-09-04 13:40:25 -05:00
parent 4b29e0458f
commit 8f590873d0
4781 changed files with 2241032 additions and 6 deletions

262
tcl/docs/db.html Normal file
View File

@@ -0,0 +1,262 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.08 [en] (X11; I; FreeBSD 3.3-RELEASE i386) [Netscape]">
</HEAD>
<BODY>
<H2>
<A NAME="Database Commands"></A>Database Commands</H2>
The database commands provide a fairly straightforward mapping to the
DB method functions.
<P>
<B>> berkdb open</B>
<dl>
<dt><B>[-btcompare <I>proc</I>]</B><dd>
Sets the Btree comparison function to the Tcl procedure named
<I>proc</I> using the
<A HREF="../../docs/api_c/db_set_bt_compare.html">DB->set_bt_compare</A>
method.
<dt><B>[-btree|-hash|-recno|-queue|-unknown]</B><dd>
</td><td>
Select the database type:<br>
DB_BTREE, DB_HASH, DB_RECNO, DB_QUEUE or DB_UNKNOWN.
<dt><B>[-cachesize {<I>gbytes bytes ncaches</I>}]</B><dd>
Sets the size of the database cache to the size specified by
<I>gbytes</I> and <I>bytes</I>, broken up into <I>ncaches</I> number of
caches using the
<A HREF="../../docs/api_c/db_set_cachesize.html">DB->set_cachesize</A>
method.
<dt><B>[-create]</B><dd>
Selects the DB_CREATE flag to create underlying files.
<dt><B>[-delim <I>delim</I>]</B><dd>
Sets the delimiting byte for variable length records to <I>delim</I>
using the
<A HREF="../../docs/api_c/db_set_re_delim.html">DB->set_re_delim</A>
method.
<dt><B>[-dup]</B><dd>
Selects the DB_DUP flag to permit duplicates in the database.
<dt><B>[-dupcompare <I>proc</I>]</B><dd>
Sets the duplicate data comparison function to the Tcl procedure named
<I>proc</I> using the
<A HREF="../../docs/api_c/db_set_dup_compare.html">DB->set_dup_compare</A>
method.
<dt><B>[-dupsort]</B><dd>
Selects the DB_DUPSORT flag to support sorted duplicates.
<dt><B>[-env <I>env</I>]</B><dd>
The database environment.
<dt><B>[-errfile <I>filename</I>]</B><dd>
Specifies the error file to use for this environment to <I>filename</I>
by calling
<A HREF="../../docs/api_c/db_set_errfile.html">DB->set_errfile</A>.
If the file already exists then we will append to the end of the file.
<dt><B>[-excl]</B><dd>
Selects the DB_EXCL flag to exclusively create underlying files.
<dt><B>[-extent <I>size</I>]</B><dd>
Sets the size of a Queue database extent to the given <I>size</I> using
the
<A HREF="../../docs/api_c/db_set_q_extentsize.html">DB->set_q_extentsize</A>
method.
<dt><B>[-ffactor <I>density</I>]</B><dd>
Sets the hash table key density to the given <I>density</I> using the
<A HREF="../../docs/api_c/db_set_h_ffactor.html">DB->set_h_ffactor</A>
method.
<dt><B>[-hashproc <I>proc</I>]</B><dd>
Sets a user-defined hash function to the Tcl procedure named <I>proc</I>
using the
<A HREF="../../docs/api_c/db_set_h_hash.html">DB->set_h_hash</A> method.
<dt><B>[-len <I>len</I>]</B><dd>
Sets the length of fixed-length records to <I>len</I> using the
<A HREF="../../docs/api_c/db_set_re_len.html">DB->set_re_len</A>
method.
<dt><B>[-lorder <I>order</I>]</B><dd>
Sets the byte order for integers stored in the database meta-data to
the given <I>order</I> using the
<A HREF="../../docs/api_c/db_set_lorder.html">DB->set_lorder</A>
method.
<dt><B>[-minkey <I>minkey</I>]</B><dd>
Sets the minimum number of keys per Btree page to <I>minkey</I> using
the
<A HREF="../../docs/api_c/db_set_bt_minkey.html">DB->set_bt_minkey</A>
method.
<dt><B>[-mode <I>mode</I>]</B><dd>
Specifies the mode for created files.
<dt><B>[-nelem <I>size</I>]</B><dd>
Sets the hash table size estimate to the given <I>size</I> using the
<A HREF="../../docs/api_c/db_set_h_nelem.html">DB->set_h_nelem</A>
method.
<dt><B>[-nommap]</B><dd>
Selects the DB_NOMMAP flag to forbid mmaping of files.
<dt><B>[-pad <I>pad</I>]</B><dd>
Sets the pad character used for fixed length records to <I>pad</I> using
the
<A HREF="../../docs/db_set_re_pad.html">DB->set_re_pad</A> method.
<dt><B>[-pagesize <I>pagesize</I>]</B><dd>
Sets the size of the database page to <I>pagesize</I> using the
<A HREF="../../docs/api_c/db_set_pagesize.html">DB->set_pagesize</A>
method.
<dt><B>[-rdonly]</B><dd>
Selects the DB_RDONLY flag for opening in read-only mode.
<dt><B>[-recnum]</B><dd>
Selects the DB_RECNUM flag to support record numbers in Btrees.
<dt><B>[-renumber]</B><dd>
Selects the DB_RENUMBER flag to support mutable record numbers.
<dt><B>[-revsplitoff]</B><dd>
Selects the DB_REVSPLITOFF flag to suppress reverse splitting of pages
on deletion.
<dt><B>[-snapshot]</B><dd>
Selects the DB_SNAPSHOT flag to support database snapshots.
<dt><B>[-source <I>file</I>]</B><dd>
Sets the backing source file name to <I>file</I> using the
<A HREF="../../docs/api_c/db_set_re_source.html">DB->set_re_source</A>
method.
<dt><B>[-truncate]</B><dd>
Selects the DB_TRUNCATE flag to truncate the database.
<dt><B>[--]</B><dd>
Terminate the list of options and use remaining arguments as the file
or subdb names (thus allowing the use of filenames beginning with a dash
'-').
<dt><B>[<I>filename </I>[<I>subdbname</I>]]</B><dd>
The names of the database and sub-database.
</dl>
<HR WIDTH="100%">
<B>> berkdb upgrade [-dupsort] [-env <I>env</I>] [--] [<I>filename</I>]</B>
<P>This command will invoke the <A HREF="../../docs/api_c/db_upgrade.html">DB->upgrade</A>
function.&nbsp; If the command is given the <B>-env</B> option, then we
will accordingly upgrade the database filename within the context of that
environment. The <B>-dupsort</B> option selects the DB_DUPSORT flag for
upgrading. The use of --<B> </B>terminates the list of options, thus allowing
filenames beginning with a dash.
<P>
<HR WIDTH="100%">
<B>> berkdb verify [-env <I>env</I>] [--] [<I>filename</I>]</B>
<P>This command will invoke the <A HREF="../../docs/api_c/db_verify.html">DB->verify</A>
function.&nbsp; If the command is given the <B>-env</B> option, then we
will accordingly verify the database filename within the context of that
environment.&nbsp; The use of --<B> </B>terminates the list of options,
thus allowing filenames beginning with a dash.
<P>
<HR WIDTH="100%"><B>> <I>db</I> del</B>
<P>There are no undocumented options.
<HR WIDTH="100%">
<B>> <I>db</I> join [-nosort] <I>db0.c0 db1.c0</I> ...</B>
<P>This command will invoke the <A HREF="../../docs/api_c/db_join.html">db_join</A>
function.&nbsp; After it successfully joins a database, we bind it to a
new Tcl command of the form <B><I>dbN.cX, </I></B>where X is an integer
starting at 0 (e.g. <B>db2.c0, db3.c0, </B>etc).&nbsp; We use the <I>Tcl_CreateObjCommand()&nbsp;</I>
to create the top level database function.&nbsp; It is through this cursor
handle that the user can access the joined data items.
<P>The options are:
<UL>
<LI>
<B>-nosort -</B> This flag causes DB not to sort the cursors based on the
number of data items they reference.&nbsp; It results in the DB_JOIN_NOSORT
flag being set.</LI>
</UL>
<P>
This command will invoke the
<A HREF="../../docs/api_c/db_create.html">db_create</A> function. If
the command is given the <B>-env</B> option, then we will accordingly
creating the database within the context of that environment. After it
successfully gets a handle to a database, we bind it to a new Tcl
command of the form <B><I>dbX, </I></B>where X is an integer starting
at 0 (e.g. <B>db0, db1, </B>etc).
<p>
We use the <I>Tcl_CreateObjCommand()</I> to create the top level
database function. It is through this handle that the user can access
all of the commands described in the <A HREF="#Database Commands">
Database Commands</A> section. Internally, the database handle
is sent as the <I>ClientData</I> portion of the new command set so that
all future database calls access the appropriate handle.
<P>
After parsing all of the optional arguments affecting the setup of the
database and making the appropriate calls to DB to manipulate those
values, we open the database for the user. It translates to the
<A HREF="../../docs/api_c/db_open.html">DB->open</A> method call after
parsing all of the various optional arguments. We automatically set the
DB_THREAD flag. The arguments are:
<HR WIDTH="100%">
<B>> <I>db</I> get_join [-nosort] {db key} {db key} ...</B>
<P>This command performs a join operation on the keys specified and returns
a list of the joined {key data} pairs.
<P>The options are:
<UL>
<LI>
<B>-nosort</B> This flag causes DB not to sort the cursors based on the
number of data items they reference.&nbsp; It results in the DB_JOIN_NOSORT
flag being set.</LI>
</UL>
<HR WIDTH="100%">
<B>> <I>db</I> keyrange [-txn <I>id</I>] key</B>
<P>This command returns the range for the given <B>key</B>.&nbsp; It returns
a list of 3 double elements of the form {<B><I>less equal greater</I></B>}
where <B><I>less</I></B> is the percentage of keys less than the given
key, <B><I>equal</I></B> is the percentage equal to the given key and <B><I>greater</I></B>
is the percentage greater than the given key.&nbsp; If the -txn option
is specified it performs this operation under transaction protection.
<HR WIDTH="100%"><B>> <I>db</I> put</B>
<P>The <B>undocumented</B> options are:
<dl>
<dt><B>-nodupdata</B><dd>
This flag causes DB not to insert the key/data pair if it already
exists, that is, both the key and data items are already in the
database. The -nodupdata flag may only be specified if the underlying
database has been configured to support sorted duplicates.
</dl>
<HR WIDTH="100%"><B>> <I>dbc</I> put</B>
<P>The <B>undocumented</B> options are:
<dl>
<dt><B>-nodupdata</B><dd>
This flag causes DB not to insert the key/data pair if it already
exists, that is, both the key and data items are already in the
database. The -nodupdata flag may only be specified if the underlying
database has been configured to support sorted duplicates.
</dl>
</BODY>
</HTML>

344
tcl/docs/env.html Normal file
View File

@@ -0,0 +1,344 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686) [Netscape]">
</head>
<body>
<h2>
Environment Commands</h2>
Environments provide a structure for creating a consistent environment
for processes using one or more of the features of Berkeley DB.&nbsp; Unlike
some of the database commands, the environment commands are very low level.
<br>
<hr WIDTH="100%">
<p>The user may create and open a new DB environment&nbsp; by invoking:
<p><b>> berkdb env</b>
<br><b>&nbsp;&nbsp;&nbsp; [-cdb] [-cdb_alldb] [-lock] [-log] [-txn [nosync]]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-create] [-home<i> directory</i>] [-mode <i>mode</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-data_dir <i>directory</i>] [-log_dir <i>directory</i>]
[-tmp_dir <i>directory</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-nommap] [-private] [-recover] [-recover_fatal]
[-system_mem] [-errfile <i>filename</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-use_environ] [-use_environ_root] [-verbose
{<i>which </i>on|off}]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-region_init]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-cachesize {<i>gbytes bytes ncaches</i>}]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-mmapsize<i> size</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-log_max <i>max</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-log_buffer <i>size</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-lock_conflict {<i>nmodes </i>{<i>matrix</i>}}]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-lock_detect default|oldest|random|youngest]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-lock_max <i>max</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-lock_max_locks <i>max</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-lock_max_lockers <i>max</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-lock_max_objects <i>max</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-lock_timeout <i>timeout</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-overwrite]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-txn_max <i>max</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-txn_timeout <i>timeout</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-client_timeout <i>seconds</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-server_timeout <i>seconds</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-server <i>hostname</i>]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-rep_master] [-rep_client]</b>
<br><b>&nbsp;&nbsp;&nbsp; [-rep_transport <i>{ machineid sendproc }</i>]</b>
<br>&nbsp;
<p>This command opens up an environment.&nbsp;&nbsp; We automatically set
the DB_THREAD and the DB_INIT_MPOOL flags.&nbsp; The arguments are:
<ul>
<li>
<b>-cdb</b> selects the DB_INIT_CDB flag for Concurrent Data Store</li>
<li>
<b>-cdb_alldb</b> selects the DB_CDB_ALLDB flag for Concurrent Data Store</li>
<li>
<b>-lock</b> selects the DB_INIT_LOCK flag for the locking subsystem</li>
<li>
<b>-log</b> selects the DB_INIT_LOG flag for the logging subsystem</li>
<li>
<b>-txn</b> selects the DB_INIT_TXN, DB_INIT_LOCK and DB_INIT_LOG flags
for the transaction subsystem.&nbsp; If <b>nosync</b> is specified, then
it will also select DB_TXN_NOSYNC to indicate no flushes of log on commits</li>
<li>
<b>-create </b>selects the DB_CREATE flag to create underlying files</li>
<li>
<b>-home <i>directory </i></b>selects the home directory of the environment</li>
<li>
<b>-data_dir <i>directory </i></b>selects the data file directory of the
environment by calling <a href="../../docs/api_c/env_set_data_dir.html">DBENV->set_data_dir</a>.</li>
<li>
<b>-log_dir <i>directory </i></b>selects the log file directory of the
environment&nbsp; by calling <a href="../../docs/api_c/env_set_lg_dir.html">DBENV->set_lg_dir</a>.</li>
<li>
<b>-tmp_dir <i>directory </i></b>selects the temporary file directory of
the environment&nbsp; by calling <a href="../../docs/api_c/env_set_tmp_dir.so">DBENV->set_tmp_dir</a>.</li>
<li>
<b>-mode <i>mode </i></b>sets the permissions of created files to <b><i>mode</i></b></li>
<li>
<b>-nommap</b> selects the DB_NOMMAP flag to disallow using mmap'ed files</li>
<li>
<b>-private</b> selects the DB_PRIVATE flag for a private environment</li>
<li>
<b>-recover</b> selects the DB_RECOVER flag for recovery</li>
<li>
<b>-recover_fatal</b> selects the DB_RECOVER_FATAL flag for catastrophic
recovery</li>
<li>
<b>-system_mem</b> selects the DB_SYSTEM_MEM flag to use system memory</li>
<li>
<b>-errfile </b>specifies the error file to use for this environment to
<b><i>filename</i></b>
by calling <a href="../../docs/api_c/env_set_errfile.html">DBENV->set_errfile</a><b><i>.
</i></b>If
the file already exists then we will append to the end of the file</li>
<li>
<b>-use_environ</b> selects the DB_USE_ENVIRON flag to affect file naming</li>
<li>
<b>-use_environ_root</b> selects the DB_USE_ENVIRON_ROOT flag to have the
root environment affect file naming</li>
<li>
<b>-verbose</b> produces verbose error output for the given which subsystem,
using the <a href="../../docs/api_c/dbenv_set_verbose.html">DBENV->set_verbose</a>
method.&nbsp;&nbsp; See the description of <a href="#> <env> verbose which on|off">verbose</a>
below for valid <b><i>which </i></b>values</li>
<li>
<b>-region_init </b>specifies that the user wants to page fault the region
in on startup using the <a href="../../docs/api_c/env_set_region_init.html">DBENV->set_region_init</a>
method call</li>
<li>
<b>-cachesize </b>sets the size of the database cache to the size&nbsp;
specified by <b><i>gbytes </i></b>and <b><i>bytes, </i></b>broken up into
<b><i>ncaches</i></b>
number of caches using the <a href="../../docs/api_c/env_set_cachesize.html">DBENV->set_cachesize</a>
method</li>
<li>
<b>-mmapsize </b>sets the size of the database page to <b><i>size </i></b>using
the <a href="../../docs/api_c/env_set_mp_mmapsize.html">DBENV->set_mp_mmapsize</a>
method</li>
<li>
<b>-log_max </b>sets the maximum size of the log file to <b><i>max</i></b>
using the <a href="../../docs/api_c/env_set_lg_max.html">DBENV->set_lg_max</a>
call</li>
<li>
<b>-log_regionmax </b>sets the size of the log region to <b><i>max</i></b>
using the <a href="../../docs/api_c/env_set_lg_regionmax.html">DBENV->set_lg_regionmax</a>
call</li>
<li>
<b>-log_buffer </b>sets the size of the log file in bytes to <b><i>size</i></b>
using the <a href="../../docs/api_c/env_set_lg_bsize.html">DBENV->set_lg_bsize</a>
call</li>
<li>
<b>-lock_conflict </b>sets the number of lock modes to <b><i>nmodes</i></b>
and sets the locking policy for those modes to the <b><i>conflict_matrix</i></b>
given using the <a href="../../docs/api_c/env_set_lk_conflict.html">DBENV->set_lk_conflict</a>
method call</li>
<li>
<b>-lock_detect </b>sets the deadlock detection policy to the given policy
using the <a href="../../docs/env_set_lk_detect.html">DBENV->set_lk_detect</a>
method call.&nbsp; The policy choices are:</li>
<ul>
<li>
<b>default</b> selects the DB_LOCK_DEFAULT policy for default detection</li>
<li>
<b>oldest </b>selects DB_LOCK_OLDEST to abort the oldest locker on a deadlock</li>
<li>
<b>random</b> selects DB_LOCK_RANDOM to abort a random locker on a deadlock</li>
<li>
<b>youngest</b> selects DB_LOCK_YOUNGEST to abort the youngest locker on
a deadlock</li>
</ul>
<li>
<b>-lock_max_locks </b>sets the maximum number of locks to <b><i>max </i></b>using
the <a href="../../docs/api_c/env_set_lk_max_locks.html">DBENV->set_lk_max_locks</a>
method call</li>
<li>
<b>-lock_max_lockers </b>sets the maximum number of locking entities to
<b><i>max
</i></b>using the <a href="../../docs/api_c/env_set_lk_max_lockers.html">DBENV->set_lk_max_lockers</a>
method call</li>
<li>
<b>-lock_max_objects </b>sets the maximum number of simultaneously locked
objects to <b><i>max </i></b>using the <a href="../../docs/api_c/env_set_lk_max_objects.html">DBENV->set_lk_max_objects</a>
method call</li>
<li>
<b>-lock_timeout </b>sets the timeout for locks in the environment</li>
<li>
<b>-overwrite </b>sets DB_OVERWRITE flag</li>
<li>
<b>-txn_max </b>sets the maximum size of the transaction table to <b><i>max</i></b>
using the <a href="../../docs/api_c/env_set_txn_max.html">DBENV->set_txn_max</a>
method call</li>
<li>
<b>-txn_timeout </b>sets the timeout for transactions in the environment</li>
<li>
<b>-client_timeout</b> sets the timeout value for the client waiting for
a reply from the server for RPC operations to <b><i>seconds</i></b>.</li>
<li>
<b>-server_timeout</b> sets the timeout value for the server to determine
an idle client is gone to <b><i>seconds</i></b>.</li>
<li>
<b>-server </b>specifies the <b><i>hostname</i></b> of the server
to connect to in the <a href="../../docs/api_c/env_set_server.html">DBENV->set_server</a>
call.</li>
<li>
<b>-rep_client </b>sets the newly created environment to be a
replication client, using the <a href="../../docs/api_c/rep_client.html">
DBENV->rep_client</a> call.</li>
<li>
<b>-rep_master </b>sets the newly created environment to be a
replication master, using the <a href="../../docs/api_c/rep_master.html">
DBENV->rep_master</a> call.</li>
<li>
<b>-rep_transport </b>specifies the replication transport function,
using the
<a href="../../docs/api_c/rep_transport.html">DBENV->rep_set_transport</a>
call. This site's machine ID is set to <b><i>machineid</i></b> and
the send function, a Tcl proc, is set to <b><i>sendproc</i></b>.</li>
</ul>
This command will invoke the <a href="../../docs/api_c/env_create.html">db_env_create</a>
function.&nbsp; After it successfully gets a handle to an environment,
we bind it to a new Tcl command of the form <b><i>envX</i></b>, where X
is an integer starting at&nbsp; 0 (e.g. <b>env0, env1, </b>etc).&nbsp;
We use the <i>Tcl_CreateObjCommand()</i> to create the top level environment
command function.&nbsp; It is through this handle that the user can access
all the commands described in the <a href="#Environment Commands">Environment
Commands</a> section.&nbsp; Internally, the handle we get back from DB
will be stored as the <i>ClientData</i> portion of the new command set
so that all future environment calls will have that handle readily available.&nbsp;
Then we call the <a href="../../docs/api_c/env_open.html">DBENV->open</a>
method call and possibly some number of setup calls as described above.
<p>
<hr WIDTH="100%">
<br><a NAME="> <env> verbose which on|off"></a><b>> &lt;env> verbose <i>which</i>
on|off</b>
<p>This command controls the use of debugging output for the environment.&nbsp;
This command directly translates to a call to the <a href="../../docs/api_c/dbenv_set_verbose.html">DBENV->set_verbose</a>
method call.&nbsp; It returns either a 0 (for success), a DB error message
or it throws a Tcl error with a system message.&nbsp; The user specifies
<b><i>which</i></b>
subsystem to control, and indicates whether debug messages should be turned
<b>on</b>
or <b>off</b> for that subsystem.&nbsp; The value of <b><i>which</i></b>
must be one of the following:
<ul>
<li>
<b>deadlock </b>- Chooses the deadlocking code by using the DB_VERB_DEADLOCK
value</li>
<li>
<b>recovery </b>- Chooses the recovery code by using the DB_VERB_RECOVERY
value</li>
<li>
<b>wait </b>- Chooses the waitsfor code by using the DB_VERB_WAITSFOR value</li>
</ul>
<hr WIDTH="100%">
<p><a NAME="> <env> close"></a><b>> &lt;env> close</b>
<p>This command closes an environment and deletes the handle.&nbsp; This
command directly translates to a call to the <a href="../../docs/api_c/env_close.html">DBENV->close</a>
method call.&nbsp; It returns either a 0 (for success), a DB error message
or it throws a Tcl error with a system message.
<p>Additionally, since the handle is no longer valid, we will call <i>Tcl_DeleteCommand()
</i>so
that further uses of the handle will be dealt with properly by Tcl itself.
<p>Also, the close command will automatically abort any <a href="txn.html">transactions</a>
and close any <a href="mpool.html">mpool</a> memory files.&nbsp; As such
we must maintain a list of open transaction and mpool handles so that we
can call <i>Tcl_DeleteCommand</i> on those as well.
<p>
<hr WIDTH="100%">
<b>> berkdb envremove<br>
[-data_dir <i>directory</i>]<br>
[-force]<br>
[-home <i>directory</i>]<br>
[-log_dir <i>directory</i>]<br>
[-overwrite]<br>
[-tmp_dir <i>directory</i>]<br>
[-use_environ]<br>
[-use_environ_root]</b>
<p>This command removes the environment if it is not in use and deletes
the handle.&nbsp; This command directly translates to a call to the <a href="../../docs/api_c/env_remove.html">DBENV->remove</a>
method call.&nbsp; It returns either a 0 (for success), a DB error message
or it throws a Tcl error with a system message.&nbsp; The arguments are:
<ul>
<li>
<b>-force</b> selects the DB_FORCE flag to remove even if other processes
have the environment open</li>
<li>
<b>-home <i>directory</i> </b>specifies the home directory of the environment</li>
<li>
<b>-data_dir <i>directory </i></b>selects the data file directory of the
environment by calling <a href="../../docs/api_c/env_set_data_dir.html">DBENV->set_data_dir</a>.</li>
<li>
<b>-log_dir <i>directory </i></b>selects the log file directory of the
environment&nbsp; by calling <a href="../../docs/api_c/env_set_lg_dir.html">DBENV->set_lg_dir</a>.</li>
<li>
<b>-overwrite </b>sets DB_OVERWRITE flag</li>
<li>
<b>-tmp_dir <i>directory </i></b>selects the temporary file directory of
the environment&nbsp; by calling <a href="../../docs/api_c/env_set_tmp_dir.so">DBENV->set_tmp_dir</a>.</li>
<li>
<b>-use_environ </b>selects the DB_USE_ENVIRON flag to affect file naming</li>
<li>
<b>-use_environ_root</b> selects the DB_USE_ENVIRON_ROOT flag to affect
file naming</li>
</ul>
</body>
</html>

168
tcl/docs/historic.html Normal file
View File

@@ -0,0 +1,168 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.08 [en] (X11; I; FreeBSD 2.2.8-19990120-SNAP i386) [Netscape]">
</HEAD>
<BODY>
<H2>
<A NAME="Compatibility Commands"></A>Compatibility Commands</H2>
The compatibility commands for old Dbm and Ndbm are described in the <A HREF="../../docs/api_c/dbm.html">dbm</A>
manpage.
<P><B>> berkdb dbminit <I>filename</I></B>
<P>This command will invoke the dbminit function.&nbsp;&nbsp; <B><I>Filename</I></B>
is used as the name of the database.
<P>
<HR WIDTH="100%"><B>> berkdb dbmclose</B>
<P>This command will invoke the dbmclose function.
<P>
<HR WIDTH="100%"><B>> berkdb fetch <I>key</I></B>
<P>This command will invoke the fetch function.&nbsp;&nbsp; It will return
the data associated with the given <B><I>key </I></B>or a Tcl error.
<P>
<HR WIDTH="100%"><B>> berkdb store <I>key data</I></B>
<P>This command will invoke the store function.&nbsp;&nbsp; It will store
the <B><I>key/data</I></B> pair.&nbsp; It will return a 0 on success or
throw a Tcl error.
<P>
<HR WIDTH="100%"><B>> berkdb delete <I>key</I></B>
<P>This command will invoke the deletet function.&nbsp;&nbsp; It will delete
the <B><I>key</I></B> from the database.&nbsp; It will return a 0 on success
or throw a Tcl error.
<P>
<HR WIDTH="100%"><B>> berkdb firstkey</B>
<P>This command will invoke the firstkey function.&nbsp;&nbsp; It will
return the first key in the database or a Tcl error.
<P>
<HR WIDTH="100%"><B>> berkdb nextkey <I>key</I></B>
<P>This command will invoke the nextkey function.&nbsp;&nbsp; It will return
the next key after the given <B><I>key</I></B> or a Tcl error.
<P>
<HR WIDTH="100%"><B>> berkdb hcreate <I>nelem</I></B>
<P>This command will invoke the hcreate function with <B><I>nelem</I></B>
elements.&nbsp; It will return a 0 on success or a Tcl error.
<P>
<HR WIDTH="100%"><B>> berkdb hsearch <I>key data action</I></B>
<P>This command will invoke the hsearch function with <B><I>key</I></B>
and <B><I>data</I></B>.&nbsp; The <B><I>action</I></B> must be either <B>find</B>
or <B>enter</B>.&nbsp; If it is <B>find</B>, it will return the resultant
data.&nbsp; If it is <B>enter</B>, it will return a 0 on success or a Tcl
error.
<P>
<HR WIDTH="100%"><B>> berkdb hdestroy</B>
<P>This command will invoke the hdestroy function.&nbsp; It will return
a 0.
<HR WIDTH="100%"><B>> berkdb ndbm_open [-create] [-rdonly] [-truncate]
[-mode
<I>mode</I>] [--] <I>filename</I></B>
<P>This command will invoke the dbm_open function.&nbsp;&nbsp;&nbsp; After
it successfully gets a handle to a database, we bind it to a new Tcl command
of the form <B><I>ndbmX, </I></B>where X is an integer starting at 0 (e.g.
<B>ndbm0,
ndbm1, </B>etc).&nbsp; We use the <I>Tcl_CreateObjCommand()&nbsp;</I> to
create the top level database function.&nbsp; It is through this handle
that the user can access all of the commands described below.&nbsp; Internally,
the database handle is sent as the <I>ClientData</I> portion of the new
command set so that all future database calls access the appropriate handle.
<P>The arguments are:
<UL>
<LI>
<B>-- </B>- Terminate the list of options and use remaining arguments as
the file or subdb names (thus allowing the use of filenames beginning with
a dash '-')</LI>
<LI>
<B>-create</B> selects the O_CREAT flag&nbsp; to create underlying files</LI>
<LI>
<B>-rdonly</B> selects the O_RDONLY flag for opening in read-only mode</LI>
<LI>
<B>-truncate</B> selects the O_TRUNC flag to truncate the database</LI>
<LI>
<B>-mode<I> mode</I></B> specifies the mode for created files</LI>
<LI>
<B><I>filename</I></B> indicates the name of the database</LI>
</UL>
<P><BR>
<HR WIDTH="100%">
<BR><B>> &lt;ndbm> close</B>
<P>This command closes the database and renders the handle invalid.&nbsp;&nbsp;
This command directly translates to the dbm_close function call.&nbsp;
It returns either a 0 (for success),&nbsp; or it throws a Tcl error with
a system message.
<P>Additionally, since the handle is no longer valid, we will call <I>Tcl_DeleteCommand()
</I>so
that further uses of the handle will be dealt with properly by Tcl itself.&nbsp;
<HR WIDTH="100%">
<BR><B>> &lt;ndbm> clearerr</B>
<P>This command clears errors&nbsp; the database.&nbsp;&nbsp; This command
directly translates to the dbm_clearerr function call.&nbsp; It returns
either a 0 (for success),&nbsp; or it throws a Tcl error with a system
message.
<P>
<HR WIDTH="100%">
<BR><B>> &lt;ndbm> delete <I>key</I></B>
<P>This command deletes the <B><I>key</I></B> from thedatabase.&nbsp;&nbsp;
This command directly translates to the dbm_delete function call.&nbsp;
It returns either a 0 (for success),&nbsp; or it throws a Tcl error with
a system message.
<P>
<HR WIDTH="100%">
<BR><B>> &lt;ndbm> dirfno</B>
<P>This command directly translates to the dbm_dirfno function call.&nbsp;
It returns either resultts,&nbsp; or it throws a Tcl error with a system
message.
<P>
<HR WIDTH="100%">
<BR><B>> &lt;ndbm> error</B>
<P>This command returns the last error.&nbsp;&nbsp; This command directly
translates to the dbm_error function call.&nbsp; It returns an error string..
<P>
<HR WIDTH="100%">
<BR><B>> &lt;ndbm> fetch <I>key</I></B>
<P>This command gets the given <B><I>key</I></B> from the database.&nbsp;&nbsp;
This command directly translates to the dbm_fetch function call.&nbsp;
It returns either the data,&nbsp; or it throws a Tcl error with a system
message.
<P>
<HR WIDTH="100%">
<BR><B>> &lt;ndbm> firstkey</B>
<P>This command returns the first key in the database.&nbsp;&nbsp; This
command directly translates to the dbm_firstkey function call.&nbsp; It
returns either the key,&nbsp; or it throws a Tcl error with a system message.
<P>
<HR WIDTH="100%">
<BR><B>> &lt;ndbm> nextkey</B>
<P>This command returns the next key in the database.&nbsp;&nbsp; This
command directly translates to the dbm_nextkey function call.&nbsp; It
returns either the key,&nbsp; or it throws a Tcl error with a system message.
<P>
<HR WIDTH="100%">
<BR><B>> &lt;ndbm> pagfno</B>
<P>This command directly translates to the dbm_pagfno function call.&nbsp;
It returns either resultts,&nbsp; or it throws a Tcl error with a system
message.
<BR>
<HR WIDTH="100%">
<BR><B>> &lt;ndbm> rdonly</B>
<P>This command changes the database to readonly.&nbsp;&nbsp; This command
directly translates to the dbm_rdonly function call.&nbsp; It returns either
a 0 (for success),&nbsp; or it throws a Tcl error with a system message.
<P>
<HR WIDTH="100%">
<BR><B>> &lt;ndbm> store <I>key data </I>insert|replace</B>
<P>This command puts the given <B><I>key</I></B> and <B><I>data</I></B>
pair into the database.&nbsp;&nbsp; This command directly translates to
the dbm_store function call.&nbsp; It will either <B>insert</B> or <B>replace</B>
the data based on the action given in the third argument.&nbsp; It returns
either a 0 (for success),&nbsp; or it throws a Tcl error with a system
message.
<BR>
<HR WIDTH="100%">
</BODY>
</HTML>

50
tcl/docs/index.html Normal file
View File

@@ -0,0 +1,50 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.08 [en] (X11; I; FreeBSD 2.2.8-19990120-SNAP i386) [Netscape]">
</HEAD>
<BODY>
<CENTER>
<H1>
Complete Tcl Interface for Berkeley DB</H1></CENTER>
<UL type=disc>
<LI>
<A HREF="../../docs/api_tcl/tcl_index.html">General use Berkeley DB commands</A></LI>
</UL>
<UL type=disc>
<LI>
<A HREF="./env.html">Environment commands</A></LI>
<LI>
<A HREF="./lock.html">Locking commands</A></LI>
<LI>
<A HREF="./log.html">Logging commands</A></LI>
<LI>
<A HREF="./mpool.html">Memory Pool commands</A></LI>
<LI>
<A HREF="./rep.html">Replication commands</A></LI>
<LI>
<A HREF="./txn.html">Transaction commands</A></LI>
</UL>
<UL>
<LI>
<A HREF="./db.html">Access Method commands</A></LI>
<LI>
<A HREF="./test.html">Debugging and Testing</A></LI>
<LI>
<A HREF="./historic.html">Compatibility commands</A></LI>
<LI>
<A HREF="./library.html">Convenience commands</A></LI>
</UL>

26
tcl/docs/library.html Normal file
View File

@@ -0,0 +1,26 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.08 [en] (X11; I; FreeBSD 2.2.8-19990120-SNAP i386) [Netscape]">
</HEAD>
<BODY>
<HR WIDTH="100%">
<H2>
<A NAME="Convenience Commands"></A>Convenience Commands</H2>
The convenience commands are provided for ease of use with the DB test
suite.
<P><B>> berkdb rand</B>
<P>This command will invoke the rand function and return the random number.
<P>
<HR WIDTH="100%"><B>> berkdb random_int <I>low high</I></B>
<P>This command will invoke the rand function and return a number between
<B><I>low</I></B>
and <B><I>high</I></B>.
<P>
<HR WIDTH="100%">
<P><B>> berkdb srand <I>seed</I></B>
<P>This command will invoke the srand function with the given <B><I>seed</I></B>
and return 0.
<P>
<HR WIDTH="100%">

206
tcl/docs/lock.html Normal file
View File

@@ -0,0 +1,206 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686) [Netscape]">
</head>
<body>
<h2>
<a NAME="Locking Commands"></a>Locking Commands</h2>
Most locking commands work with the environment handle.&nbsp; However,
when a user gets a lock we create a new lock handle that they then use
with in a similar manner to all the other handles to release the lock.&nbsp;
We present the general locking functions first, and then those that manipulate
locks.
<p><b>> &lt;env> lock_detect [default|oldest|youngest|random]</b>
<p>This command runs the deadlock detector.&nbsp; It directly translates
to the <a href="../../docs/api_c/lock_detect.html">lock_detect</a> DB call.&nbsp;
It returns either a 0 (for success), a DB error message or it throws a
Tcl error with a system message.&nbsp; The first argument sets the policy
for deadlock as follows:
<ul>
<li>
<b>default</b> selects the DB_LOCK_DEFAULT policy for default detection
(default if not specified)</li>
<li>
<b>oldest </b>selects DB_LOCK_OLDEST to abort the oldest locker on a deadlock</li>
<li>
<b>random</b> selects DB_LOCK_RANDOM to abort a random locker on a deadlock</li>
<li>
<b>youngest</b> selects DB_LOCK_YOUNGEST to abort the youngest locker on
a deadlock</li>
</ul>
<hr WIDTH="100%">
<br><b>> &lt;env> lock_stat</b>
<p>This command returns a list of name/value pairs where the names correspond
to the C-structure field names of DB_LOCK_STAT and the values are the data
returned.&nbsp; This command is a direct translation of the <a href="../../docs/api_c/lock_stat.html">lock_stat</a>
DB call.
<hr WIDTH="100%">
<br><a NAME="> <env> lock_id"></a><b>> &lt;env> lock_id</b>
<p>This command returns a unique locker ID value.&nbsp; It directly translates
to the <a href="../../docs/api_c/lock_id.html">lock_id</a> DB call.
<br>
<hr WIDTH="100%">
<br><a NAME="> <env> lock_id"></a><b>> &lt;env> lock_id_free&nbsp; </b><i>locker</i>
<p>This command frees the locker allockated by the lock_id call. It directly
translates to the&nbsp; <a href="../../docs/api_c/lock_id.html">lock_id_free
</a>DB
call.
<hr WIDTH="100%">
<br><a NAME="> <env> lock_id"></a><b>> &lt;env> lock_id_set&nbsp; </b><i>current
max</i>
<p>This&nbsp; is a diagnostic command to set the locker id that will get
allocated next and the maximum id that
<br>will trigger the id reclaim algorithm.
<hr WIDTH="100%">
<br><a NAME="> <env> lock_get"></a><b>> &lt;env> lock_get [-nowait]<i>lockmode
locker obj</i></b>
<p>This command gets a lock. It will invoke the <a href="../../docs/api_c/lock_get.html">lock_get</a>
function.&nbsp; After it successfully gets a handle to a lock, we bind
it to a new Tcl command of the form <b><i>$env.lockX</i></b>, where X is
an integer starting at&nbsp; 0 (e.g. <b>$env.lock0, $env.lock1, </b>etc).&nbsp;
We use the <i>Tcl_CreateObjCommand()</i> to create the top level locking
command function.&nbsp; It is through this handle that the user can release
the lock.&nbsp; Internally, the handle we get back from DB will be stored
as the <i>ClientData</i> portion of the new command set so that future
locking calls will have that handle readily available.
<p>The arguments are:
<ul>
<li>
<b><i>locker</i></b> specifies the locker ID returned from the <a href="#> <env> lock_id">lock_id</a>
command</li>
<li>
<b><i>obj</i></b> specifies an object to lock</li>
<li>
the <b><i>lock mode</i></b> is specified as one of the following:</li>
<ul>
<li>
<b>ng </b>specifies DB_LOCK_NG for not granted (always 0)</li>
<li>
<b>read</b> specifies DB_LOCK_READ for a read (shared) lock</li>
<li>
<b>write</b> specifies DB_LOCK_WRITE for an exclusive write lock</li>
<li>
<b>iwrite </b>specifies DB_LOCK_IWRITE for intent for exclusive write lock</li>
<li>
<b>iread </b>specifies DB_LOCK_IREAD for intent for shared read lock</li>
<li>
<b>iwr </b>specifies DB_LOCK_IWR for intent for eread and write lock</li>
</ul>
<li>
<b>-nowait</b> selects the DB_LOCK_NOWAIT to indicate that we do not want
to wait on the lock</li>
</ul>
<hr WIDTH="100%">
<br><b>> &lt;lock> put</b>
<p>This command releases the lock referenced by the command.&nbsp; It is
a direct translation of the <a href="../../docs/api_c/lock_put.html">lock_put</a>
function.&nbsp; It returns either a 0 (for success), a DB error message
or it throws a Tcl error with a system message.&nbsp; Additionally, since
the handle is no longer valid, we will call
<i>Tcl_DeleteCommand()
</i>so
that further uses of the handle will be dealt with properly by Tcl itself.
<br>
<hr WIDTH="100%">
<br><a NAME="> <env> lock_vec"></a><b>> &lt;env> lock_vec [-nowait] <i>locker
</i>{get|put|put_all|put_obj
[<i>obj</i>] [<i>lockmode</i>] [<i>lock</i>]} ...</b>
<p>This command performs a series of lock calls.&nbsp; It is a direct translation
of the <a href="../../docs/api_c/lock_vec.html">lock_vec</a> function.&nbsp;
This command will return a list of the return values from each operation
specified in the argument list.&nbsp; For the 'put' operations the entry
in the return value list is either a 0 (for success) or an error.&nbsp;
For the 'get' operation, the entry is the lock widget handle, <b>$env.lockN</b>
(as described above in <a href="#> <env> lock_get">&lt;env> lock_get</a>)
or an error.&nbsp; If an error occurs, the return list will contain the
return values for all the successful operations up the erroneous one and
the error code for that operation.&nbsp; Subsequent operations will be
ignored.
<p>As for the other operations, if we are doing a 'get' we will create
the commands and if we are doing a 'put' we will have to delete the commands.&nbsp;
Additionally, we will have to do this after the call to the DB lock_vec
and iterate over the results, creating and/or deleting Tcl commands.&nbsp;
It is possible that we may return a lock widget from a get operation that
is considered invalid, if, for instance, there was a <b>put_all</b> operation
performed later in the vector of operations.&nbsp; The arguments are:
<ul>
<li>
<b><i>locker</i></b> specifies the locker ID returned from the <a href="#> <env> lock_id">lock_id</a>
command</li>
<li>
<b>-nowait</b> selects the DB_LOCK_NOWAIT to indicate that we do not want
to wait on the lock</li>
<li>
the lock vectors are tuple consisting of {an operation, lock object, lock
mode, lock handle} where what is required is based on the operation desired:</li>
<ul>
<li>
<b>get</b> specifes DB_LOCK_GET to get a lock.&nbsp; Requires a tuple <b>{get
<i>objmode</i>}
</b>where
<b><i>mode</i></b>
is:</li>
<ul>
<li>
<b>ng </b>specifies DB_LOCK_NG for not granted (always 0)</li>
<li>
<b>read</b> specifies DB_LOCK_READ for a read (shared) lock</li>
<li>
<b>write</b> specifies DB_LOCK_WRITE for an exclusive write lock</li>
<li>
<b>iwrite </b>specifies DB_LOCK_IWRITE for intent for exclusive write lock</li>
<li>
<b>iread </b>specifies DB_LOCK_IREAD for intent for shared read lock</li>
<li>
<b>iwr </b>specifies DB_LOCK_IWR for intent for eread and write lock</li>
</ul>
<li>
<b>put</b> specifies DB_LOCK_PUT to release a <b><i>lock</i></b>.&nbsp;
Requires a tuple <b>{put <i>lock}</i></b></li>
<li>
<b>put_all </b>specifies DB_LOCK_PUT_ALL to release all locks held by <b><i>locker</i></b>.&nbsp;
Requires a tuple <b>{put_all}</b></li>
<li>
<b>put_obj</b> specifies DB_LOCK_PUT_OBJ to release all locks held by <b><i>locker</i></b>
associated with the given <b><i>obj</i></b>.&nbsp; Requires a tuple <b>{put_obj
<i>obj}</i></b></li>
</ul>
</ul>
<hr WIDTH="100%">
<br><a NAME="> <env> lock_vec"></a><b>> &lt;env> lock_timeout <i>timeout</i></b>
<p>This command sets the lock timeout for all future locks in this environment.&nbsp;
The timeout is in micorseconds.
<br>&nbsp;
<br>&nbsp;
</body>
</html>

123
tcl/docs/log.html Normal file
View File

@@ -0,0 +1,123 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.08 [en] (X11; I; FreeBSD 3.3-RELEASE i386) [Netscape]">
</HEAD>
<BODY>
<H2>
<A NAME="Logging Commands"></A>Logging Commands</H2>
Logging commands work from the environment handle to control the use of
the log files.&nbsp; Log files are opened when the environment is opened
and closed when the environment is closed.&nbsp; In all of the commands
in the logging subsystem that take or return a log sequence number, it
is of the form:
<BR><B>{<I>fileid offset</I>}</B>
<BR>where the <B><I>fileid</I></B> is an identifier of the log file, as
returned from the <A HREF="#> <env> log_get">log_get</A> call.
<P><B>> &lt;env> log_archive [-arch_abs] [-arch_data] [-arch_log]</B>
<P>This command returns&nbsp; a list of log files that are no longer in
use.&nbsp; It is a direct call to the <A HREF="../../docs/api_c/log_archive.html">log_archive</A>
function. The arguments are:
<UL>
<LI>
<B>-arch_abs </B>selects DB_ARCH_ABS to return all pathnames as absolute
pathnames</LI>
<LI>
<B>-arch_data </B>selects DB_ARCH_DATA to return a list of database files</LI>
<LI>
<B>-arch_log </B>selects DB_ARCH_LOG to return a list of log files</LI>
</UL>
<HR WIDTH="100%">
<BR><B>> &lt;env> log_compare <I>lsn1 lsn2</I></B>
<P>This command compares two log sequence numbers, given as <B><I>lsn1</I></B>
and <B><I>lsn2</I></B>.&nbsp; It is a direct call to the <A HREF="../../docs/api_c/log_compare.html">log_compare</A>
function.&nbsp; It will return a -1, 0, 1 to indicate if <B><I>lsn1</I></B>
is less than, equal to or greater than <B><I>lsn2</I></B> respectively.
<BR>
<HR WIDTH="100%">
<BR><B>> &lt;env> log_file <I>lsn</I></B>
<P>This command returns&nbsp; the file name associated with the given <B><I>lsn</I></B>.&nbsp;
It is a direct call to the <A HREF="../../docs/api_c/log_file.html">log_file</A>
function.
<BR>
<HR WIDTH="100%">
<BR><B>> &lt;env> log_flush [<I>lsn</I>]</B>
<P>This command&nbsp; flushes the log up to the specified <B><I>lsn</I></B>
or flushes all records if none is given&nbsp; It is a direct call to the
<A HREF="../../docs/api_c/log_flush.html">log_flush</A>
function.&nbsp; It returns either a 0 (for success), a DB error message
or it throws a Tcl error with a system message.
<BR>
<HR WIDTH="100%">
<BR><A NAME="<env> log_get"></A><B>> &lt;env> log_get<I> </I>[-checkpoint]
[-current] [-first] [-last] [-next] [-prev] [-set <I>lsn</I>]</B>
<P>This command retrieves a record from the log according to the <B><I>lsn</I></B>
given and returns it and the data.&nbsp; It is a direct call to the <A HREF="../../docs/api_c/log_get.html">log_get</A>
function.&nbsp; It is a way of implementing a manner of log iteration similar
to <A HREF="../../docs/api_tcl/db_cursor.html">cursors</A>.&nbsp;&nbsp;
The information we return is similar to database information.&nbsp; We
return a list where the first item is the LSN (which is a list itself)
and the second item is the data.&nbsp; So it looks like, fully expanded,
<B>{{<I>fileid</I>
<I>offset</I>}
<I>data</I>}.</B>&nbsp;
In the case where DB_NOTFOUND is returned, we return an empty list <B>{}</B>.&nbsp;
All other errors return a Tcl error.&nbsp; The arguments are:
<UL>
<LI>
<B>-checkpoint </B>selects the DB_CHECKPOINT flag to return the LSN/data
pair of the last record written through <A HREF="#> <env> log_put">log_put</A>
with DB_CHECKPOINT specified</LI>
<LI>
<B>-current</B> selects the DB_CURRENT flag to return the current record</LI>
<LI>
<B>-first</B> selects the DB_FIRST flag to return the first record in the
log.</LI>
<LI>
<B>-last </B>selects the DB_LAST flag to return the last record in the
log.</LI>
<LI>
<B>-next</B> selects the DB_NEXT flag to return the next record in the
log.</LI>
<LI>
<B>-prev </B>selects the DB_PREV flag to return the&nbsp; previous record
in the log.</LI>
<LI>
<B>-set</B> selects the DB_SET flag to return the record specified by the
given <B><I>lsn</I></B></LI>
</UL>
<HR WIDTH="100%">
<BR><A NAME="> <env> log_put"></A><B>> &lt;env> log_put<I> </I>[-checkpoint]
[-flush] <I>record</I></B>
<P>This command stores a <B><I>record</I></B> into the log and returns
the LSN of the log record.&nbsp; It is a direct call to the <A HREF="../../docs/api_c/log_put.html">log_put</A>
function.&nbsp; It returns either an LSN or it throws a Tcl error with
a system message.&nbsp;<B> </B>The arguments are:
<UL>
<LI>
<B>-checkpoint </B>selects the DB_CHECKPOINT flag</LI>
<LI>
<B>-flush </B>selects the DB_FLUSH flag to flush the log to disk.</LI>
</UL>
<HR WIDTH="100%">
<BR><B>> &lt;env> log_stat</B>
<P>This command returns&nbsp; the statistics associated with the logging
subsystem.&nbsp; It is a direct call to the <A HREF="../../docs/api_c/log_stat.html">log_stat</A>
function.&nbsp; It returns a list of name/value pairs of the DB_LOG_STAT
structure.
</BODY>
</HTML>

189
tcl/docs/mpool.html Normal file
View File

@@ -0,0 +1,189 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.08 [en] (X11; I; FreeBSD 2.2.8-19990120-SNAP i386) [Netscape]">
</HEAD>
<BODY>
<H2>
<A NAME="Memory Pool Commands"></A>Memory Pool Commands</H2>
Memory pools are used in a manner similar to the other subsystems.&nbsp;
We create a handle to the pool and&nbsp; then use it for a variety of operations.&nbsp;
Some of the memory pool commands use the environment instead. Those are
presented first.
<P><B>> &lt;env> mpool_stat</B>
<P>This command returns&nbsp; the statistics associated with the memory
pool subsystem.&nbsp; It is a direct call to the <A HREF="../../docs/api_c/memp_stat.html">memp_stat</A>
function.&nbsp; It returns a list of name/value pairs of the DB_MPOOL_STAT
structure.
<BR>
<HR WIDTH="100%">
<BR><B>> &lt;env> mpool_sync <I>lsn</I></B>
<P>This command flushes the memory pool for all pages with a log sequence
number less than <B><I>lsn</I></B>.&nbsp; It is a direct call to the <A HREF="../../docs/api_c/memp_sync.html">memp_sync&nbsp;</A>
function.&nbsp; It returns either a 0 (for success), a DB error message
or it throws a Tcl error with a system message.
<BR>
<HR WIDTH="100%">
<BR><B>> &lt;env> mpool_trickle <I>percent</I></B>
<P>This command tells DB to ensure that at least <B><I>percent</I></B>
percent of the pages are clean by writing out enough to dirty pages to
achieve that percentage.&nbsp; It is a direct call to the <A HREF="../../docs/api_c/memp_trickle.html">memp_trickle</A>
function.&nbsp; The command will return the number of pages actually written.&nbsp;
It returns either the number of pages on success, or it throws a Tcl error
with a system message.
<BR>
<HR WIDTH="100%">
<P><B>> &lt;env> mpool [-create] [-nommap] [-rdonly] [-mode <I>mode</I>]
-pagesize <I>size</I> [<I>file</I>]</B>
<P>This command creates a new memory pool.&nbsp; It invokes the <A HREF="../../docs/api_c/memp_fopen.html">memp_fopen</A>
function.&nbsp; After it successfully gets a handle to a memory pool, we
bind it to a new Tcl command of the form <B><I>$env.mpX</I></B>, where
X is an integer starting at&nbsp; 0 (e.g. <B>$env.mp0, $env.mp1, </B>etc).&nbsp;
We use the <I>Tcl_CreateObjCommand()</I> to create the top level memory
pool functions.&nbsp; It is through this handle that the user can manipulate
the pool.&nbsp; Internally, the handle we get back from DB will be stored
as the <I>ClientData</I> portion of the new command set so that future
memory pool calls will have that handle readily available.&nbsp; Additionally,
we need to maintain this handle in relation to the environment so that
if the user calls <A HREF="../../docs/api_tcl/env_close.html">&lt;env> close</A> without closing
the memory pool we can properly clean up.&nbsp; The arguments are:
<UL>
<LI>
<B><I>file</I></B> is the name of the file to open</LI>
<LI>
<B>-create </B>selects the DB_CREATE flag to create underlying file</LI>
<LI>
<B>-mode <I>mode </I></B>sets the permissions of created file to <B><I>mode</I></B></LI>
<LI>
<B>-nommap</B> selects the DB_NOMMAP flag to disallow using mmap'ed files</LI>
<LI>
<B>-pagesize</B> sets the underlying file page size to <B><I>size</I></B></LI>
<LI>
<B>-rdonly </B>selects the DB_RDONLY flag for read only access</LI>
</UL>
<HR WIDTH="100%">
<BR><B>> &lt;mp> close</B>
<P>This command closes the memory pool.&nbsp; It is a direct call to the
<A HREF="../../docs/api_c/memp_fclose.html">memp_close</A>
function.&nbsp; It returns either a 0 (for success), a DB error message
or it throws a Tcl error with a system message.
<P>Additionally, since the handle is no longer valid, we will call
<I>Tcl_DeleteCommand()
</I>so
that further uses of the handle will be dealt with properly by Tcl itself.&nbsp;
We must also remove the reference to this handle from the environment.&nbsp;
We will go through the list of pinned pages that were acquired by the <A HREF="#> <mp> get">get</A>
command and
<A HREF="#> <pg> put">put</A> them back.
<HR WIDTH="100%">
<BR><B>> &lt;mp> fsync</B>
<P>This command flushes all of the file's dirty pages to disk.&nbsp; It
is a direct call to the <A HREF="../../docs/api_c/memp_fsync.html">memp_fsync</A>
function.&nbsp; It returns either a 0 (for success), a DB error message
or it throws a Tcl error with a system message.
<HR WIDTH="100%">
<BR><A NAME="> <mp> get"></A><B>> &lt;mp> get [-create] [-last] [-new]
[<I>pgno</I>]</B>
<P>This command gets the&nbsp; <B><I>pgno </I></B>page from the memory
pool.&nbsp; It invokes the <A HREF="../../docs/api_c/memp_fget.html">memp_fget</A>
function and possibly the <A HREF="../../docs/api_c/memp_fset.html">memp_fset</A>
function if any options are chosen to set the page characteristics.&nbsp;
After it successfully gets a handle to a page,&nbsp; we bind it to and
return a new Tcl command of the form <B><I>$env.mpN.pX</I></B>, where X
is an integer starting at&nbsp; 0 (e.g. <B>$env.mp0.p0, $env.mp1.p0, </B>etc).&nbsp;
We use the <I>Tcl_CreateObjCommand()</I> to create the top level page functions.&nbsp;
It is through this handle that the user can manipulate the page.&nbsp;
Internally, the handle we get back from DB will be stored as the <I>ClientData</I>
portion of the new command set.&nbsp; We need to store this handle in&nbsp;
relation to the memory pool handle so that if the memory pool is closed,
we will <A HREF="#> <pg> put">put</A> back the pages (setting the discard
flag) and delete that set of commands.
<P>The arguments are:
<UL>
<LI>
<B>-create </B>selects the DB_MPOOL_CREATE flag&nbsp; to create the page
if it does not exist.</LI>
<LI>
<B>-last</B> selects the DB_MPOOL_LAST flag to return the last page in
the file</LI>
<LI>
<B>-new</B> selects the DB_MPOOL_NEW flag to create a new page</LI>
</UL>
<HR WIDTH="100%">
<BR><B>> &lt;pg> pgnum</B>
<P>This command returns the page number associated with this memory pool
page.&nbsp; Primarily it will be used after an <A HREF="#> <mp> get">&lt;mp>
get</A> call.
<BR>
<HR WIDTH="100%"><B>> &lt;pg> pgsize</B>
<P>This command returns the page size associated with this memory pool
page.&nbsp; Primarily it will be used after an <A HREF="#> <mp> get">&lt;mp>
get</A> call.
<BR>
<HR WIDTH="100%"><B>> &lt;pg> set [-clean] [-dirty] [-discard]</B>
<P>This command sets the characteristics of the page.&nbsp; It is a direct
call to the <A HREF="../../docs/api_c/memp_fset.html">memp_fset</A> function.&nbsp;
It returns either a 0 (for success), a DB error message or it throws a
Tcl error with a system message.&nbsp; The arguments are:
<UL>
<LI>
<B>-clean</B> selects the DB_MPOOL_CLEAN flag to indicate this is a clean
page</LI>
<LI>
<B>-dirty</B> selects the DB_MPOOL_DIRTY flag to indicate this page should
be flushed before eviction</LI>
<LI>
<B>-discard</B> selects the DB_MPOOL_DISCARD flag to indicate this page
is unimportant</LI>
</UL>
<HR WIDTH="100%">
<BR><A NAME="> <pg> put"></A><B>> &lt;pg> put [-clean] [-dirty] [-discard]</B>
<P>This command will put back the page to the memory pool.&nbsp; It is
a direct call to the <A HREF="../../docs/api_c/memp_fput.html">memp_fput</A>
function.&nbsp; It returns either a 0 (for success), a DB error message
or it throws a Tcl error with a system message. Additionally, since the
handle is no longer valid, we will call
<I>Tcl_DeleteCommand()
</I>so that
further uses of the handle will be dealt with properly by Tcl itself.&nbsp;
We must also remove the reference to this handle from the memory pool.
<P>The arguments are:
<UL>
<LI>
<B>-clean</B> selects the DB_MPOOL_CLEAN flag to indicate this is a clean
page</LI>
<LI>
<B>-dirty</B> selects the DB_MPOOL_DIRTY flag to indicate this page should
be flushed before eviction</LI>
<LI>
<B>-discard</B> selects the DB_MPOOL_DISCARD flag to indicate this page
is unimportant</LI>
</UL>
<HR WIDTH="100%">
<BR><B>> &lt;pg> init <I>val|string</I></B>
<P>This command initializes the page to the <B><I>val</I></B> given or
places the <B><I>string</I></B> given at the beginning of the page.&nbsp;
It returns a 0 for success or it throws a Tcl error with an error message.
<P>
<HR WIDTH="100%">
<BR><B>> &lt;pg> is_setto <I>val|string</I></B>
<P>This command verifies the page contains the <B><I>val</I></B> given
or checks that the <B>string</B> given is at the beginning of the page.&nbsp;
It returns a 1 if the page is correctly set to the value and a 0 otherwise.

50
tcl/docs/rep.html Normal file
View File

@@ -0,0 +1,50 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Replication commands</title>
</head>
<body>
<h2>
<a NAME="Replication Commands"></a>Replication Commands</h2>
Replication commands are invoked from the environment handle, after
it has been opened with the appropriate flags defined
<a href="./env.html">here</a>.<br>
<hr WIDTH="100%">
<p><b>> &lt;env> rep_process_message <i>machid</i> <i>control</i>
<i>rec</i></b>
<p>This command processes a single incoming replication message.&nbsp; It
is a direct translation of the <a
href="../../docs/api_c/rep_process_message.html">rep_process_message</a>
function.&nbsp;
It returns either a 0 (for success), a DB error message or it throws a
Tcl error with a system message.&nbsp; The arguments are:
<ul>
<li>
<b>machid </b>is the machine ID of the machine that <i>sent</i> this
message.</li>
<li>
<b>control</b> is a binary string containing the exact contents of the
<b><i>control</i></b> argument to the <b><i>sendproc</i></b> function
that was passed this message on another site.</li>
<li>
<b>rec</b> is a binary string containing the exact contents of the
<b><i>rec</i></b> argument to the <b><i>sendproc</i></b> function
that was passed this message on another site.</li>
</ul>
<hr WIDTH="100%">
<br><b>> &lt;env> rep_elect <i>nsites</i> <i>pri</i> <i>wait</i>
<i>sleep</i></b>
<p>This command causes a replication election.&nbsp; It is a direct translation
of the <a href="../../docs/api_c/rep_elect.html">rep_elect</a> function.&nbsp;
Its arguments, all integers, correspond exactly to that C function's
parameters.
It will return a list containing two integers, which contain,
respectively, the integer values returned in the C function's
<i><b>midp</b></i> and <i><b>selfp</b></i> parameters.
</body>
</html>

93
tcl/docs/sequence.html Normal file
View File

@@ -0,0 +1,93 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
<title>Sequence Commands</title>
</head>
<body>
<h2><a name="Database Commands"></a>Sequence Commands</h2>
<b>&gt; berkdb sequence [-auto_commit] [-txn txnid] [-create] </b><br>
<div style="margin-left: 40px;">&nbsp;Implements <a
href="file:///home/ubell/db.new/docs/seq/seq_open.html">DBENV-&gt;sequence</a>
function. The above options have the usual meanings.<br>
</div>
<span style="font-weight: bold;">[-cachesize]</span><br>
<div style="margin-left: 40px;">Set the size of the cache in this
handle.<br>
</div>
<span style="font-weight: bold;">[-inc]<br>
</span>
<div style="margin-left: 40px;">Sequence increments..<br>
</div>
<span style="font-weight: bold;">[-dec]<br>
</span>
<div style="margin-left: 40px;">Sequence decrements.<br>
</div>
<span style="font-weight: bold;">[-init integer]<br>
</span>
<div style="margin-left: 40px;">Set the initial value for sequence.<br>
</div>
<span style="font-weight: bold;">[-max integer]</span><br>
<div style="margin-left: 40px;">Set the maximum value for the sequence.<br>
</div>
<span style="font-weight: bold;">[-max integer]<br>
</span>
<div style="margin-left: 40px;">Set the minimum value for the sequence.<br>
</div>
<span style="font-weight: bold;">[-wrap]</span><br>
<div style="margin-left: 40px;">Wrap around at max or min.<br>
</div>
<span style="font-weight: bold;"><span style="font-style: italic;">db</span>
key<br>
</span>
<div style="margin-left: 40px;">Database handle and key of sequence.<br>
</div>
<hr width="100%"><span style="font-style: italic;"><span
style="font-weight: bold;">&gt; seq </span></span><span
style="font-weight: bold;">get [-txn <span style="font-style: italic;">txn</span>]
[-auto_commit] [-nosync] delta<br>
</span>
<div style="margin-left: 40px;">Get the nexted sequence value and
increment the sequence by <span style="font-weight: bold;">delta</span>.<br>
</div>
<hr width="100%"><span style="font-weight: bold;">&gt; <span
style="font-style: italic;">seq </span>close</span><br>
<div style="margin-left: 40px;">Close the sequence<br>
</div>
<br>
<hr width="100%"><span style="font-weight: bold;">&gt; <span
style="font-style: italic;">seq</span> remove [-auto_commit] [-nosync]
[-txn] <br>
</span>
<div style="margin-left: 40px;">Remove the sequence.<br>
</div>
<hr width="100%"><span style="font-weight: bold;">&gt; <span
style="font-style: italic;">seq </span>get_cachesize<br>
</span>
<div style="margin-left: 40px;">Return the size of the cache.<br>
</div>
<hr width="100%"><span style="font-weight: bold;">&gt; <span
style="font-style: italic;">seq </span>get_db<br>
</span>
<div style="margin-left: 40px;">Return the underlying db handle.<br>
</div>
<hr width="100%"><span style="font-weight: bold;">&gt; <span
style="font-style: italic;">seq </span>get_flags</span><br>
<div style="margin-left: 40px;">Return the flags set on create.<br>
</div>
<hr width="100%"><span style="font-weight: bold;">&gt; <span
style="font-style: italic;">seq</span> get_range<br>
</span>
<div style="margin-left: 40px;">Return the min and max set at create.<br>
</div>
<hr width="100%"><span style="font-weight: bold;">&gt; <span
style="font-style: italic;">seq </span>stat<br>
</span>
<div style="margin-left: 40px;">Implements the <a
href="../../docs/seq/seq_stat.html">SEQUENCE-&gt;stat</a> function.<br>
</div>
<hr width="100%">
</body>
</html>

103
tcl/docs/test.html Normal file
View File

@@ -0,0 +1,103 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.08 [en] (X11; I; FreeBSD 2.2.8-19990120-SNAP i386) [Netscape]">
</HEAD>
<BODY>
<H2>
<A NAME="Debugging"></A>Debugging and Testing</H2>
We have imported the debugging system from the old test suite into the
new interface to aid in debugging problems.&nbsp; There are several variables
that are available both in gdb as globals to the C code, and variables
in Tcl that the user can set.&nbsp; These variables are linked together
so that changes in one venue are reflected in the other.&nbsp; The names
of the variables have been modified a bit to reduce the likelihood
<BR>of namespace trampling.&nbsp; We have added a double underscore to
all the names.
<P>The variables are all initialized to zero (0) thus resulting in debugging
being turned off.&nbsp; The purpose of the debugging, fundamentally, is
to allow the user to set a breakpoint prior to making a DB call.&nbsp;
This breakpoint is set in the <I>__db_loadme() </I>function.&nbsp; The
user may selectively turn on various debugging areas each controlled by
a separate variable (note they all have two (2) underscores prepended to
the name):
<UL>
<LI>
<B>__debug_on</B> - Turns on the debugging system.&nbsp; This must be on
for any debugging to occur</LI>
<LI>
<B>__debug_print - </B>Turns on printing a debug count statement on each
call</LI>
<LI>
<B>__debug_test -</B> Hits the breakpoint in <I>__db_loadme</I> on the
specific iteration</LI>
<LI>
<B>__debug_stop </B>- Hits the breakpoint in <I>__db_loadme</I> on every
(or the next) iteration</LI>
</UL>
<B>Note to developers:</B>&nbsp; Anyone extending this interface must place
a call to <B>_debug_check()</B> (no arguments) before every call into the
DB library.
<P>There is also a command available that will force a call to the _debug_check
function.
<P><B>> berkdb debug_check</B>
<P>
<HR WIDTH="100%">
<BR>For testing purposes we have added several hooks into the DB library
and a small interface into the environment and/or database commands to
manipulate the hooks.&nbsp; This command interface and the hooks and everything
that goes with it is only enabled when the test option is configured into
DB.
<P><B>> &lt;env> test copy <I>location</I></B>
<BR><B>> &lt;db> test copy <I>location</I></B>
<BR><B>> &lt;env> test abort <I>location</I></B>
<BR><B>> &lt;db> test abort <I>location</I></B>
<P>In order to test recovery we need to be able to abort the creation or
deletion process at various points.&nbsp; Also we want to invoke a copy
function to copy the database file(s)&nbsp; at various points as well so
that we can obtain before/after snapshots of the databases.&nbsp; The interface
provides the test command to specify a <B><I>location</I></B> where we
wish to invoke a <B>copy</B> or an <B>abort</B>.&nbsp; The command is available
from either the environment or the database for convenience.&nbsp; The
<B><I>location</I></B>
can be one of the following:
<UL>
<LI>
<B>none -</B> Clears the location</LI>
<LI>
<B>preopen -</B> Sets the location prior to the __os_open call in the creation
process</LI>
<LI>
<B>postopen</B> - Sets the location to immediately following the __os_open
call in creation</LI>
<LI>
<B>postlogmeta</B> - Sets the location to immediately following the __db_log_page
call to log the meta data in creation.&nbsp; Only valid for Btree.</LI>
<LI>
<B>postlog</B> - Sets the location to immediately following the last (or
only) __db_log_page call in creation.</LI>
<LI>
<B>postsync</B> - Sets the location to immediately following the sync of
the log page in creation.</LI>
<LI>
<B>prerename</B> - Sets the location prior to the __os_rename call in the
deletion process.</LI>
<LI>
<B>postrename</B> - Sets the location to immediately following the __os_rename
call in deletion</LI>
</UL>
</BODY>
</HTML>

69
tcl/docs/txn.html Normal file
View File

@@ -0,0 +1,69 @@
<!--Copyright 1999,2008 Oracle. All rights reserved.-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686) [Netscape]">
</head>
<body>
<h2>
<a NAME="Transaction Commands"></a>Transaction Commands</h2>
Transactions are used in a manner similar to the other subsystems.&nbsp;
We create a handle to the transaction and&nbsp; then use it for a variety
of operations.&nbsp; Some of the transaction commands use the environment
instead.&nbsp; Those are presented first.&nbsp; The transaction command
handle returned is the handle used by the various commands that can be
transaction protected, such as <a href="../../docs/api_tcl/db_cursor.html">cursors</a>.
<br>
<hr WIDTH="100%">
<p><b>> &lt;env> txn_checkpoint [-kbyte <i>kb</i>] [-min <i>min</i>]</b>
<p>This command causes a checkpoint of the transaction region.&nbsp; It
is a direct translation of the <a href="../../docs/api_c/txn_checkpoint.html">txn_checkpoint
</a>function.&nbsp;
It returns either a 0 (for success), a DB error message or it throws a
Tcl error with a system message.&nbsp; The arguments are:
<ul>
<li>
<b>-force</b>causes the checkpoint to occur regardless of inactivity
<li>
<b>-kbyte</b>causes the checkpoint to occur only if <b><i>kb</i></b> kilobytes
of log data has been written since the last checkpoint
<li>
<b>-min</b> causes the checkpoint to occur only if <b><i>min</i></b> minutes
have passed since the last checkpoint
</ul>
<hr WIDTH="100%">
<br><b>> &lt;env> txn_stat</b>
<p>This command returns transaction statistics.&nbsp; It is a direct translation
of the <a href="../../docs/api_c/txn_stat.html">txn_stat</a> function.&nbsp;
It will return a list of name/value pairs that correspond to the DB_TXN_STAT
structure.
<hr WIDTH="100%">
<br><b>> &lt;env> txn_id_set&nbsp;</b><i> current max</i>
<p>This is a diagnosic command that sets the next transaction id to be
allocated and the maximum transaction
<br>id, which is the point at which the relcaimation algorthm is triggered.
<hr WIDTH="100%">
<br><b>>&nbsp; &lt;txn> id</b>
<p>This command returns the transaction id.&nbsp; It is a direct call to
the <a href="../../docs/api_c/txn_id.html">txn_id</a> function.&nbsp; The
typical use of this identifier is as the <b><i>locker</i></b> value for
the <a href="lock.html">lock_get</a> and <a href="lock.html">lock_vec</a>
calls.
<hr WIDTH="100%">
<br><b>> &lt;txn> prepare</b>
<p>This command initiates a two-phase commit.&nbsp; It is a direct call
to the <a href="../../docs/api_c/txn_prepare.html">txn_prepare</a> function.&nbsp;
It returns either a 0 (for success), a DB error message or it throws a
Tcl error with a system message.
<hr WIDTH="100%"><a NAME="> <env> lock_vec"></a><b>> &lt;env> txn_timeout
<i>timeout</i></b>
<p>This command sets thetransaction timeout for transactions started in
the future in this environment.&nbsp; The timeout is in micorseconds.
<br>&nbsp;
<br>&nbsp;
</body>
</html>