<html> <head> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Storing Transient Fields</title> <link rel="stylesheet" type="text/css" href="../../../style.css"> </head> <body> <div class="CommonContent"> <div class="CommonContentArea"> <h1>Storing Transient Fields</h1><script> //We attach this function to a browser object as a variable so that if multiple of these blocks are //present on the same page, then they will simply over-write eachother with the same function instead //of generating a naming collision. window.WikiCodeFormattingCopyToClipboard = function copyToClipboard(sID){ var sContent = document.getElementById(sID).innerText; if( window.clipboardData && clipboardData.setData ) { clipboardData.setData("Text", sContent); } else { alert("You must enable javascript access to your clipboard for this feature to work. Please referr to your browser documentation or Google search for instructions."); } } </script> <span name="cs_wiki_filter" csw_filters="cs"><p>c#: </p> <p><code>Db4oFactory.Configure().ObjectClass(clazz).StoreTransientFields(true)</code></p> </span> <span name="cs_wiki_filter" csw_filters="vb"><p>VB: </p> <p><code>Db4oFactory.Configure().ObjectClass(clazz).StoreTransientFields(true)</code></p> </span> <p>This setting can be used to turn on storing of transient fields to db4o. It can be sometimes useful for debug purposes. </p> <p>In order to test how it works add the following method to the example in <a href="transient_fields_in_java.html" class="wikiLink">Transient Fields In Java</a>/<a href="transient_fields_in_.net.html" class="wikiLink">Transient Fields In .NET</a>:</p> <span name="cs_wiki_filter" csw_filters="cs"> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">MarkTransientExample.cs: <span class="fscMemberName">ConfigureSaveTransient</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceTuningSelective_PersistenceselectivepersistenceCS.ZipsMarkTransientExample.Cs_MarkTransientExample.Cs_ConfigureSaveTransient_676_87"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">1</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> IConfiguration ConfigureSaveTransient() </span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="ResourcesReferenceTuningSelective_PersistenceselectivepersistenceCS.ZipsMarkTransientExample.Cs_MarkTransientExample.Cs_ConfigureSaveTransient_676_87_63_263_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceselectivepersistenceCS.ZipsMarkTransientExample.Cs_MarkTransientExample.Cs_ConfigureSaveTransient_676_87_63_263_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceselectivepersistenceCS.ZipsMarkTransientExample.Cs_MarkTransientExample.Cs_ConfigureSaveTransient_676_87_63_263_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceselectivepersistenceCS.ZipsMarkTransientExample.Cs_MarkTransientExample.Cs_ConfigureSaveTransient_676_87_63_263_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningSelective_PersistenceselectivepersistenceCS.ZipsMarkTransientExample.Cs_MarkTransientExample.Cs_ConfigureSaveTransient_676_87_63_263_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceselectivepersistenceCS.ZipsMarkTransientExample.Cs_MarkTransientExample.Cs_ConfigureSaveTransient_676_87_63_263_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceselectivepersistenceCS.ZipsMarkTransientExample.Cs_MarkTransientExample.Cs_ConfigureSaveTransient_676_87_63_263_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceselectivepersistenceCS.ZipsMarkTransientExample.Cs_MarkTransientExample.Cs_ConfigureSaveTransient_676_87_63_263_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceTuningSelective_PersistenceselectivepersistenceCS.ZipsMarkTransientExample.Cs_MarkTransientExample.Cs_ConfigureSaveTransient_676_87_63_263_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceTuningSelective_PersistenceselectivepersistenceCS.ZipsMarkTransientExample.Cs_MarkTransientExample.Cs_ConfigureSaveTransient_676_87_63_263_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> IConfiguration configuration </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.NewConfiguration(); </span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> configuration.ObjectClass(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Test)).StoreTransientFields(</span><span style="color: #0000FF;">true</span><span style="color: #000000;">); </span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> configuration; </span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> }</span></span></div></pre></div></div> </span> <span name="cs_wiki_filter" csw_filters="vb"> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">MarkTransientExample.vb: <span class="fscMemberName">ConfigureSaveTransient</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceTuningSelective_PersistenceSelectivePersistenceVB.ZipsMarkTransientExample.Vb_MarkTransientExample.Vb_ConfigureSaveTransient_827_87"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">1</span><img id="ResourcesReferenceTuningSelective_PersistenceSelectivePersistenceVB.ZipsMarkTransientExample.Vb_MarkTransientExample.Vb_ConfigureSaveTransient_827_87_14_280_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceSelectivePersistenceVB.ZipsMarkTransientExample.Vb_MarkTransientExample.Vb_ConfigureSaveTransient_827_87_14_280_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceSelectivePersistenceVB.ZipsMarkTransientExample.Vb_MarkTransientExample.Vb_ConfigureSaveTransient_827_87_14_280_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceSelectivePersistenceVB.ZipsMarkTransientExample.Vb_MarkTransientExample.Vb_ConfigureSaveTransient_827_87_14_280_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningSelective_PersistenceSelectivePersistenceVB.ZipsMarkTransientExample.Vb_MarkTransientExample.Vb_ConfigureSaveTransient_827_87_14_280_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceSelectivePersistenceVB.ZipsMarkTransientExample.Vb_MarkTransientExample.Vb_ConfigureSaveTransient_827_87_14_280_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceSelectivePersistenceVB.ZipsMarkTransientExample.Vb_MarkTransientExample.Vb_ConfigureSaveTransient_827_87_14_280_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningSelective_PersistenceSelectivePersistenceVB.ZipsMarkTransientExample.Vb_MarkTransientExample.Vb_ConfigureSaveTransient_827_87_14_280_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceTuningSelective_PersistenceSelectivePersistenceVB.ZipsMarkTransientExample.Vb_MarkTransientExample.Vb_ConfigureSaveTransient_827_87_14_280_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Function ConfigureSaveTransient()</span><span id="ResourcesReferenceTuningSelective_PersistenceSelectivePersistenceVB.ZipsMarkTransientExample.Vb_MarkTransientExample.Vb_ConfigureSaveTransient_827_87_14_280_Open_Text"><span style="color: #0000FF;">Function</span><span style="color: #000000;"> ConfigureSaveTransient() </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IConfiguration </span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> configuration </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IConfiguration </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.NewConfiguration() </span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> configuration.ObjectClass(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Test)).StoreTransientFields(</span><span style="color: #0000FF;">True</span><span style="color: #000000;">) </span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Return</span><span style="color: #000000;"> configuration </span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> </span><span style="color: #0000FF;">End Function</span></span></div></pre></div></div> </span> <span name="cs_wiki_filter" csw_filters="net"> <p>Note, that attributes, marked as transient, won't be affected by <code>storeTransientFields</code> setting.</p> </span></div> </div> <div id="footer"> This revision (2) was last Modified 2007-03-21T19:12:05 by Tetyana. </div> </body> </html>