1<!--$Id: server.so,v 1.8 2002/06/17 18:38:43 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: Server program</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<a name="2"><!--meow--></a> 12<table width="100%"><tr valign=top> 13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>RPC Client/Server</dl></b></td> 14<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> 15</td></tr></table> 16<p align=center><b>Server program</b></p> 17<p>The Berkeley DB server utility, <a href="/utility/berkeley_db_svc.html">berkeley_db_svc</a>, handles all the 18client application requests.</p> 19<p>Currently, the <a href="/utility/berkeley_db_svc.html">berkeley_db_svc</a> utility is single-threaded, 20limiting the number of requests that it can handle. Modifying the 21server implementation to run in multithread or multiprocess mode 22requires modification of the server code automatically generated by the 23rpcgen program.</p> 24<p>There are two different types of timeouts used by <a href="/utility/berkeley_db_svc.html">berkeley_db_svc</a>. 25The first timeout (which can be modified within some constraints by the 26client application), is the resource timeout. When clients use 27transactions or cursors, those resources hold locks in Berkeley DB across calls 28to the server. If a client application dies or loses its connection to 29the server while holding those resources, it prevents any other client 30from acquiring them. Therefore, it is important to detect that a client 31has not used a resource for some period of time and release them. In the 32case of transactions, the server aborts the transaction. In the case of 33cursors, the server closes the cursor.</p> 34<p>The second timeout is an idle timeout. A client application may remain 35idle with an open handle to an environment and a database. Doing so 36simply consumes some memory; it does not hold locks. However, the Berkeley DB 37server may want to eventually reclaim resources if a client dies or 38remains disconnected for a long period of time, so there is a separate 39idle timeout for open Berkeley DB handles.</p> 40<p>The list of home directories specified to <a href="/utility/berkeley_db_svc.html">berkeley_db_svc</a> are 41the only ones client applications are allowed to use. When 42<a href="/utility/berkeley_db_svc.html">berkeley_db_svc</a> is started, it is given a list of pathnames. 43Clients are expected to specify the name of the home directory (defined 44as the last component in the directory pathname) as the database 45environment they are opening. In this manner, clients need to know only 46the name of their home environment; not its full pathname on the server 47machine. This means, of course, that only one environment of a 48particular name is allowed on the server at any given time.</p> 49<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> 50</td></tr></table> 51<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 52</body> 53</html> 54