Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Activation: As you said db4o uses it's <a href="http://developer.db4o.com/Documentation/Reference/db4o-8.0/net35/reference/Content/basics/activation.htm" rel="nofollow">activation-mechanism</a> to control which objects are loaded. To prevent that to many objects are loaded there are different strategies.</p> <ul> <li>Lower the <a href="http://developer.db4o.com/Documentation/Reference/db4o-8.0/net35/reference/Content/configuration/common/activation_depth.htm" rel="nofollow">global default activation-depth</a>: <code>configuration.Common.ActivationDepth = 2</code> Then use the strategies below to activate objects on need.</li> <li>Use class-specific activation configuration like <a href="http://developer.db4o.com/Documentation/Reference/db4o-8.0/net35/reference/Content/configuration/objectclass/cascade_on-activate.htm" rel="nofollow">cascading activation</a>, <a href="http://developer.db4o.com/Documentation/Reference/db4o-8.0/net35/reference/Content/configuration/objectclass/minimum_activation_depth.htm" rel="nofollow">minimum</a> and <a href="http://developer.db4o.com/Documentation/Reference/db4o-8.0/net35/reference/Content/configuration/objectclass/maximum_activation_depth.htm" rel="nofollow">maximun</a> activation-depth etc.</li> <li>Activate objects explicit on demand: <code>container.Activate(theObject,5)</code></li> </ul> <p>However all these stuff is rather painful on complex object graphs. The only strategy to get away from that pain is <a href="http://developer.db4o.com/Documentation/Reference/db4o-8.0/net35/reference/Content/basics/activation_concept/transparent_activation_framework/ta_enhanced_example/ta_enhancement_with_db4otool.htm" rel="nofollow">transparent activation</a>. Create an attribute like TransparentlyActivated. Use this attribute to mark your stored classes. Then use the <a href="http://developer.db4o.com/Documentation/Reference/db4o-8.0/net35/reference/Content/advanced_topics/enhancement_tools/enhancement_for_.net/db4otool.htm" rel="nofollow">db4otool</a> to enhance your classes. Add the db4otool-command to the Post-Build events in Visual Studio: Like <code>'PathTo\Db4oTool.exe -ta -debug -by-attribute:YourNamespace.TransparentlyActivated $(TargetPath)</code></p> <p>Guid, Generic Collections: No (in Version 7.12 or 8.0). However if you store your own structs: Those are handled very poorly by db4o</p> <p>WebApplication: I recommend an embedded-container, and then a <a href="http://developer.db4o.com/Documentation/Reference/db4o-8.0/net35/reference/Content/platform_specific_issues/web_environment.htm" rel="nofollow">session-container for each request</a>.</p> <p><strong>Update for extended question part</strong></p> <p>To your case. For such complex activation schema I would use transparent activation. I assume you are using properties and not public fields in your real scenario, otherwise transparent persistence doesn't work.</p> <p>The transparent activation basically loads an object in the moment a method/property is called the first. So when you access the property A.R then A itself it loaded, but not the referenced objects. I just go through a few of you access patterns to show what I mean:</p> <p>Getting 'A.BList.C.BList.A.R'</p> <ul> <li>A is loaded when you access A.BList. The BList array is filled with unactivate objects</li> <li>You keep navigating further to BList.C. At this moment the BList object is loaded</li> <li>Then you access C.BList. db4o loads the C-object</li> <li>And so on and so forth.</li> </ul> <p>So when you get 'A.BList.C.BList.A.R' then 'A.R' isn't loaded</p> <p>A unloaded object is represented by an 'empty'-shell object, which has all values set to null or the default value. Arrays are always fully loaded, but first filled with unactivated objects.</p> <p>Note that theres no real query syntax to do some kind of elaborate load requests. You load your start object and then pull stuff in as you need it.</p> <p>I also need to mention that this kind of access will perform terrible over the network with db4o. </p> <p>Yet another hint. If you want to do elaborate work on a graph-structure, you also should take a look at graph databases, like <a href="http://neo4j.org/" rel="nofollow">Neo4J</a> or <a href="http://www.sones.com/home" rel="nofollow">Sones Graph DB</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload