<?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="Basics Operations & Concepts" MadCap:InPreviewMode="false" MadCap:RuntimeFileType="Topic" MadCap:TargetType="WebHelp" MadCap:PathToHelpSystem="../../" MadCap:HelpSystemFileName="index.xml" MadCap:SearchType="Stem"> <head><title>Update Concept</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#basics/update_concept.htm" style="">Open topic with navigation</a> </p> <div class="MCBreadcrumbsBox"><span class="MCBreadcrumbsPrefix">You are here: </span><a class="MCBreadcrumbsLink" href="../basics.htm">Basics Operations & Concepts</a><span class="MCBreadcrumbsDivider"> > </span><span class="MCBreadcrumbs">Update Concept</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="kanchor29"></a>Update Concept</h1> <p>Updating objects in db4o is as easy as storing them. You just call then store-method again to update a object. How does a update work? There are two main questions. First, how does db4o recognize a object so that it knows whenever it should update a object or store it as a new object? And what's the scope of updates? All all objects updated? Or just the objects you explicitly store?</p> <h2>Object Recognition</h2> <p>How does db4o know which object needs to be updated and which object has to be stored as new object? Well db4o uses the <a href="identity_concept.htm">object-identity</a> and looks up it if has loaded this object. If the object was loaded by db4o, it is an existing object and will be updated. Otherwise it has to be a new object and is stored as a new object.</p> <h2>Update Depth</h2> <p>When you update of a object, db4o only stores the changes to a certain depth. This update depth avoids that db4o needs to go through the whole object graph and find out which objects have changed. </p> <p>By default this update depth is one. This means when you update a object, only the changes on that object are stored. Changes on other objects are not included. When you want to store changes of multiple objects you need either to increase the <a href="../configuration/common/update_depth.htm">update-depth</a>, store each object individually or use <a href="update_concept/transparent_persistence.htm">transparent persistence</a>. </p> <p>Take a look at this concrete example to see how the update-depth affects you're operations. <a href="update_concept/update_depth_in_action.htm" target="" title="" alt="" class="MCXref" xrefformat="See "{paratext}"">See "Update Depth In Action"</a></p> <p>Since collection are regular object in db4o the update depth also applies to collections. <a href="update_concept/updating_collections.htm" target="" title="" alt="" class="MCXref" xrefformat="See "{paratext}"">See "Updating Collections"</a></p> <p>If you want to automate the update process of object: <a href="update_concept/transparent_persistence.htm" target="" title="" alt="" class="MCXref" xrefformat="See "{paratext}"">See "Transparent Persistence"</a></p> <script type="text/javascript" src="../SkinSupport/MadCapBodyEnd.js"> </script> </body> </html>