Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 2e9c43658e374d290a2de15d25134ac8 > files > 639

db4o-doc-8.0-1.fc15.i686.rpm

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="2" MadCap:lastHeight="120" MadCap:lastWidth="624" MadCap:disableMasterStylesheet="true" MadCap:tocPath="" MadCap:InPreviewMode="false" MadCap:RuntimeFileType="Topic" MadCap:TargetType="WebHelp" MadCap:PathToHelpSystem="../" MadCap:HelpSystemFileName="index.xml" MadCap:SearchType="Stem">
    <head><title>Configuration</title>
        <script type="text/javascript">/* <![CDATA[ */
window.onload = function(){
	var pathToFlash = $('html').attr('MadCap:PathToHelpSystem') + 'Content/Resources/Code/ZeroClipboard.swf';
	ZeroClipboard.setMoviePath(pathToFlash);
			
	function bindToClipBord(element,content){
		var clip = new ZeroClipboard.Client();
		clip.setText(content);
		clip.glue(element);
	};
		
	if(location.protocol==='file:'){
		$('.copylink-marker').remove();
	} else{
			$('.copylink-marker').each(function(){
				var text = $(this).parent().parent().children('.prettyprint').html();
				$(this).hover(function(){
					bindToClipBord(this,text);
				},
				function(){});
			});	
	}		
	prettyPrint();	
};
                /* ]]> */</script>
        <link href="SkinSupport/MadCap.css" rel="stylesheet" />
        <link href="Resources/Stylesheets/OnlineStyle.css" rel="stylesheet" />
        <script src="Resources/Code/prettify.js">
        </script>
        <script src="Resources/Code/lang-vb.js">
        </script>
        <script src="Resources/Code/jquery.min.js">
        </script>
        <script src="Resources/Code/ZeroClipboard.js">
        </script>
        <script src="SkinSupport/MadCapAll.js" type="text/javascript">
        </script>
    </head>
    <body>
        <p class="MCWebHelpFramesetLink" style="display: none;"><a href="../index_CSH.html#configuration.htm" style="">Open topic with navigation</a>
        </p>
        <div class="MCBreadcrumbsBox"><span class="MCBreadcrumbsPrefix">You are here: </span><span class="MCBreadcrumbs">Configuration</span>
        </div>
        <p>
            <script type="text/javascript">/*<![CDATA[*/document.write('<a href="' + location.href +'">');
				document.write("Direct Link");
			document.write('</a>');/*]]>*/</script>
        </p>
        <p>
        </p>
        <h1><a name="kanchor37"></a>Configuration</h1>
        <p>db4o is configured by its configuration API. The configuration allows you to adjust db4o to your scenarios. </p>
        <h2>Configure db4o</h2>
        <p>In order to configure db4o, you need to create a new configuration-instance and set the desired settings on it. After that, you pass the configuration-instance to the object-container factory.</p>
        <p> Note that you cannot share a configuration-instance. For each object-container you create, you need to pass in a new configuration-instance.  It's recommended to create a method which will return a new configuration instance on request:</p>
        <h2>Embedded-Configuration</h2>
        <p>For an embedded container you can configure the <a href="configuration/common_configuration.htm">common</a>-, <a href="configuration/file_configuration.htm">file</a>- and <a href="configuration/id_system.htm">id-system</a>-configuration.</p>
        <div class="codesnippet" MadCap:conditions="Primary.c#">
            <pre class="prettyprint" xml:space="preserve">IEmbeddedConfiguration configuration = Db4oEmbedded.NewConfiguration();
// change the configuration...
IObjectContainer container = Db4oEmbedded.OpenFile(configuration, "database.db4o");</pre>
            <div class="codesnippet-meta">ConfigurationBasics.cs: Configure embedded object container
			<div class="codedownload"><a href="CodeExamples/configuration/basics/Example-configuration-basics-csharp.zip" class="codedownload" MadCap:conditions="Primary.Online">Download Code</a></div><div class="codedownload copylink-marker" MadCap:conditions="Primary.Online"><a href="#copy">Copy Code</a></div></div>
        </div>
        <div class="codesnippet" MadCap:conditions="Primary.VB.NET">
            <pre class="prettyprint lang-vb" MadCap:conditions="Primary.Online" xml:space="preserve">Dim configuration As IEmbeddedConfiguration = Db4oEmbedded.NewConfiguration()
' change the configuration...
Dim container As IObjectContainer = Db4oEmbedded.OpenFile(configuration, "database.db4o")</pre>
            <div class="codesnippet-meta">ConfigurationBasics.vb: Configure embedded object container
			<div class="codedownload"><a href="CodeExamples/configuration/basics/Example-configuration-basics-vb.zip" class="codedownload" MadCap:conditions="Primary.Online">Download Code</a></div><div class="codedownload copylink-marker" MadCap:conditions="Primary.Online"><a href="#copy">Copy Code</a></div></div>
        </div>
        <h2>Server-Configuration</h2>
        <p>For an server you can configure the <a href="configuration/common_configuration.htm">common</a>-, <a href="configuration/file_configuration.htm">file</a>-, <a href="configuration/network_configuration.htm">networking</a>-, <a href="configuration/server_configuration.htm">server</a>- and <a href="configuration/id_system.htm">id-system</a>-configuration.</p>
        <div class="codesnippet" MadCap:conditions="Primary.c#">
            <pre class="prettyprint" xml:space="preserve">IServerConfiguration configuration = Db4oClientServer.NewServerConfiguration();
// change the configuration...
IObjectServer server = Db4oClientServer.OpenServer(configuration, "database.db4o", 1337);</pre>
            <div class="codesnippet-meta">ConfigurationBasics.cs: Configure the db4o-server
			<div class="codedownload"><a href="CodeExamples/configuration/basics/Example-configuration-basics-csharp.zip" class="codedownload" MadCap:conditions="Primary.Online">Download Code</a></div><div class="codedownload copylink-marker" MadCap:conditions="Primary.Online"><a href="#copy">Copy Code</a></div></div>
        </div>
        <div class="codesnippet" MadCap:conditions="Primary.VB.NET">
            <pre class="prettyprint lang-vb" MadCap:conditions="Primary.Online" xml:space="preserve">Dim configuration As IServerConfiguration = Db4oClientServer.NewServerConfiguration()
' change the configuration...
Dim server As IObjectServer = Db4oClientServer.OpenServer(configuration, "database.db4o", 1337)</pre>
            <div class="codesnippet-meta">ConfigurationBasics.vb: Configure the db4o-server
			<div class="codedownload"><a href="CodeExamples/configuration/basics/Example-configuration-basics-vb.zip" class="codedownload" MadCap:conditions="Primary.Online">Download Code</a></div><div class="codedownload copylink-marker" MadCap:conditions="Primary.Online"><a href="#copy">Copy Code</a></div></div>
        </div>
        <h2>Client-Configuration</h2>
        <p>For an client you can configure the <a href="configuration/common_configuration.htm">common</a>-,  <a href="configuration/network_configuration.htm">networking</a>-, <a href="configuration/client_configuration.htm">client</a>- and <a href="configuration/id_system.htm">id-system</a>-configuration.</p>
        <div class="codesnippet" MadCap:conditions="Primary.c#">
            <pre class="prettyprint" xml:space="preserve">IClientConfiguration configuration = Db4oClientServer.NewClientConfiguration();
// change the configuration...
IObjectContainer container = Db4oClientServer.OpenClient(configuration, "localhost", 1337, "user", "pwd");</pre>
            <div class="codesnippet-meta">ConfigurationBasics.cs: Configure a client object container
			<div class="codedownload"><a href="CodeExamples/configuration/basics/Example-configuration-basics-csharp.zip" class="codedownload" MadCap:conditions="Primary.Online">Download Code</a></div><div class="codedownload copylink-marker" MadCap:conditions="Primary.Online"><a href="#copy">Copy Code</a></div></div>
        </div>
        <div class="codesnippet" MadCap:conditions="Primary.VB.NET">
            <pre class="prettyprint lang-vb" MadCap:conditions="Primary.Online" xml:space="preserve">Dim configuration As IClientConfiguration = Db4oClientServer.NewClientConfiguration()
' change the configuration...
Dim container As IObjectContainer = Db4oClientServer.OpenClient(configuration, "localhost", 1337, "user", "pwd")</pre>
            <div class="codesnippet-meta">ConfigurationBasics.vb: Configure a client object container
			<div class="codedownload"><a href="CodeExamples/configuration/basics/Example-configuration-basics-vb.zip" class="codedownload" MadCap:conditions="Primary.Online">Download Code</a></div><div class="codedownload copylink-marker" MadCap:conditions="Primary.Online"><a href="#copy">Copy Code</a></div></div>
        </div>
        <h2>Configuration Is Not Persistent</h2>
        <p>The db4o configuration is not persistent with a few exception. This means that you need to configure db4o each time you create a object-container instance. </p>
        <h2>Configuration in Client/Server-Mode</h2>
        <p>  For using db4o in client/server mode it is recommended to use the same configuration on the server and on the client.  To set this up nicely it makes sense to create one application class with one method that returns the required configuration and to deploy this class both to the server and to all clients.</p>
        <h2>Configuration-Settings Overview</h2>
        <p>The configuration-settings which are common across -client, embedded and db4o-server are summed up here: <a href="configuration/common_configuration.htm" target="" title="" alt="" class="MCXref" xrefformat="See &quot;{paratext}&quot;">See "Common Configuration"</a></p>
        <p>&#160;</p>
        <p>&#160;</p>
        <script type="text/javascript" src="SkinSupport/MadCapBodyEnd.js">
        </script>
    </body>
</html>