server.html   [plain text]


<!--$Id: server.so,v 1.8 2002/06/17 18:38:43 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: Server program</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<a name="2"><!--meow--></a>
<table width="100%"><tr valign=top>
<td><b><dl><dt>Berkeley DB Reference Guide:<dd>RPC Client/Server</dl></b></td>
<td align=right><a href="../rpc/client.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../rpc/faq.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p align=center><b>Server program</b></p>
<p>The Berkeley DB server utility, <a href="../../utility/berkeley_db_svc.html">berkeley_db_svc</a>, handles all the
client application requests.</p>
<p>Currently, the <a href="../../utility/berkeley_db_svc.html">berkeley_db_svc</a> utility is single-threaded,
limiting the number of requests that it can handle.  Modifying the
server implementation to run in multithread or multiprocess mode
requires modification of the server code automatically generated by the
rpcgen program.</p>
<p>There are two different types of timeouts used by <a href="../../utility/berkeley_db_svc.html">berkeley_db_svc</a>.
The first timeout (which can be modified within some constraints by the
client application), is the resource timeout.  When clients use
transactions or cursors, those resources hold locks in Berkeley DB across calls
to the server.  If a client application dies or loses its connection to
the server while holding those resources, it prevents any other client
from acquiring them.  Therefore, it is important to detect that a client
has not used a resource for some period of time and release them.  In the
case of transactions, the server aborts the transaction.  In the case of
cursors, the server closes the cursor.</p>
<p>The second timeout is an idle timeout.  A client application may remain
idle with an open handle to an environment and a database.  Doing so
simply consumes some memory; it does not hold locks.  However, the Berkeley DB
server may want to eventually reclaim resources if a client dies or
remains disconnected for a long period of time, so there is a separate
idle timeout for open Berkeley DB handles.</p>
<p>The list of home directories specified to <a href="../../utility/berkeley_db_svc.html">berkeley_db_svc</a> are
the only ones client applications are allowed to use.  When
<a href="../../utility/berkeley_db_svc.html">berkeley_db_svc</a> is started, it is given a list of pathnames.
Clients are expected to specify the name of the home directory (defined
as the last component in the directory pathname) as the database
environment they are opening.  In this manner, clients need to know only
the name of their home environment; not its full pathname on the server
machine.  This means, of course, that only one environment of a
particular name is allowed on the server at any given time.</p>
<table width="100%"><tr><td><br></td><td align=right><a href="../rpc/client.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../rpc/faq.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>