1<!--$Id: intro.so,v 1.18 2006/11/13 18:05:03 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: Introduction to the RPC client/server</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="/sequence/intro.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/rpc/client.html"><img src="/images/next.gif" alt="Next"></a> 15</td></tr></table> 16<p align=center><b>Introduction to the RPC client/server</b></p> 17<p>Berkeley DB includes an implementation of a client-server protocol using Sun 18Microsystem's Remote Procedure Call Protocol. RPC support is 19available only for UNIX systems, and is not included in the Berkeley DB library by 20default, but must be enabled during configuration. See 21<a href="/ref/build_unix/conf.html">Configuring Berkeley DB</a> for more 22information. For more information on RPC itself, see your UNIX system 23documentation or <i>RPC: Remote Procedure Call Protocol 24Specification, RFC1831, Sun Microsystems, Inc., USC-ISI</i>.</p> 25<p>Only some of the complete Berkeley DB functionality is available when using RPC. 26The following functionality is available:</p> 27<ol> 28<li>The <a href="/api_c/env_class.html">db_env_create</a> function and the <a href="/api_c/env_class.html">DB_ENV</a> handle 29methods. 30<li>The <a href="/api_c/db_class.html">db_create</a> function and the <a href="/api_c/db_class.html">DB</a> handle methods. 31<li>The <a href="/api_c/txn_begin.html">DB_ENV->txn_begin</a>, <a href="/api_c/txn_commit.html">DB_TXN->commit</a>, and <a href="/api_c/txn_abort.html">DB_TXN->abort</a> methods. 32</ol> 33<p>The <a href="/api_c/env_open.html#DB_THREAD">DB_THREAD</a> flag to the <a href="/api_c/env_open.html">DB_ENV->open</a> and <a href="/api_c/db_open.html">DB->open</a> methods 34may not be specified, that is, <a href="/api_c/env_class.html">DB_ENV</a> and <a href="/api_c/db_class.html">DB</a> handles used 35in RPC clients are not free-threaded.</p> 36<p>The RPC client/server code does not support any of the user-defined 37comparison or allocation functions; for example, an application using 38the RPC support may not specify its own Btree comparison function. If 39your application requires only those portions of Berkeley DB, then using RPC 40is fairly simple. If your application requires other Berkeley DB 41functionality, such as direct access to locking, logging or shared 42memory buffer memory pools, then your application cannot use the RPC 43support.</p> 44<p>Although a client cannot specify a callback, Berkeley DB does support the 45<a href="/api_c/db_associate.html">DB->associate</a> call in a limited manner. A client program 46wanting to use a secondary index may do so only in a read-only fashion. 47The primary and secondary databases must have been created locally on 48the server machine. Client programs must then open both the primary 49and secondary databases with the <a href="/api_c/db_open.html#DB_RDONLY">DB_RDONLY</a> flag set. The client 50must also specify a NULL callback for the <a href="/api_c/db_associate.html">DB->associate</a> call.</p> 51<p>The Berkeley DB RPC code requires that the client and server programs be 52running the exact same version numbers. 53The Berkeley DB RPC protocol version number is tied to the Berkeley DB major 54and minor release numbers. 55As such, the server program will reject requests from clients 56using a different version number.</p> 57<p><b>The Berkeley DB RPC support does not provide any security or authentication of 58any kind.</b> Sites needing any kind of data security measures must modify 59the client and server code to provide whatever level of security they 60require.</p> 61<p>One particularly interesting use of the RPC support is for debugging Berkeley DB 62applications. The seamless nature of the interface means that with very 63minor application code changes, an application can run outside of the 64Berkeley DB address space, making it far easier to track down many types of 65errors -- such as memory misuse.</p> 66<p>Using the RPC mechanisms in Berkeley DB involves two basic steps:</p> 67<ol> 68<p><li>Modify your Berkeley DB application to act as a client and call the RPC 69server. 70<li>Run the <a href="/utility/berkeley_db_svc.html">berkeley_db_svc</a> server program on the system where the 71database resides. 72</ol> 73<table width="100%"><tr><td><br></td><td align=right><a href="/sequence/intro.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/rpc/client.html"><img src="/images/next.gif" alt="Next"></a> 74</td></tr></table> 75<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 76</body> 77</html> 78