Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 780

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Activation</title>
    <link rel="stylesheet" type="text/css" href="../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Activation</h1>
<P>Activation is a db4o mechanism, which controls object's fields instantiation. Why is it necessary? Let's look at an example of a database, that has a Tree structure, i.e. there is one Root object, which has N nodes, each node in its turn has K subnodes etc. Let the whole structure has M levels. What happens when you run a query, retrieving the root object? All the sub-objects will have to be created in the memory. If N,K,M are large numbers, you will most probably end up with the OutOfMemory exception.</P>
<P>Luckily db4o does not behave like this - when query retrieves objects, their fields are loaded into memory (activated in db4o terms) only to a certain depth - activation depth. In this case depth means "number of member references away from the original object". All the fields at lower levels (below activation depth) are set to null (for classes) or to default values (for primitive types).</P>
<P>Activation occurs in the following cases:</P>
<OL>
<LI>ObjectSet#next() is called on an ObjectSet retrieved in a query;</LI>
<LI>Object is activated explicitly with ObjectContainer#activate(object, depth);</LI>
<LI>built-in collection element is accessed;</LI>
<LI>for the environment collections (.NET, Java) their members are activated automatically, when the collection is activated, using at least depth 1 for lists and depth 2 for maps.</LI></OL>
<P><div class="childTopicList">More Reading:<ul>
<li><p><a href="activation/global_activation_settings.html" class="wikiLink">Global Activation Settings</a></p></li>
<li><p><a href="activation/object-specific_activation.html" class="wikiLink">Object-Specific Activation</a></p></li>
<li><p><a href="activation/transparent_activation_framework.html" class="wikiLink">Transparent Activation Framework</a></p></li>
</ul></div>
</P></div>
    </div>
    <div id="footer">
					This revision (8) was last Modified 2006-11-14T18:20:20 by Eric Falsken.
				</div>
  </body>
</html>