Symbian3/PDK/Source/GUID-C7FB54C4-43C9-562A-A18C-2818AF624774.dita
changeset 5 f345bda72bc4
parent 3 46218c8b8afa
child 14 578be2adaf3e
equal deleted inserted replaced
4:4816d766a08a 5:f345bda72bc4
     7     Nokia Corporation - initial contribution.
     7     Nokia Corporation - initial contribution.
     8 Contributors: 
     8 Contributors: 
     9 -->
     9 -->
    10 <!DOCTYPE concept
    10 <!DOCTYPE concept
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    12 <concept xml:lang="en" id="GUID-C7FB54C4-43C9-562A-A18C-2818AF624774"><title>Permanent file store</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>A permanent file store implements most of the operations defined by the store abstract framework. Most importantly, streams in a permanent file store can be:</p> <ul><li id="GUID-5D731E0A-C4B7-56CE-AC27-25118A58506A"><p>overwritten</p> </li> <li id="GUID-13FF892F-8241-59A6-A39F-D0F2705F79A0"><p>replaced</p> </li> <li id="GUID-A8E9E699-6017-58FA-BC54-155B7838A172"><p>deleted</p> </li> <li id="GUID-95C70244-4BE3-5E20-83FA-1B1DCFB03F49"><p>created in advance of being written to.</p> </li> </ul> <p>A permanent file store is useful for the type of application which treats the data in the store as its prime copy. Typically, the object network comprising the application’s data is structured so that sections of data can be loaded in, and, if changed, written back to the store. Memory is used as a workplace for changing data. Such an application never replaces the entire store. This approach requires a sophisticated structure and greater sophistication within the application.</p> <p>Typically, a permanent file store is used by an application, such as a database, which maintains all its data in a file, but occasionally edits some entries in that database.</p> <p> In this paradigm:</p> <ul><li id="GUID-56E7EE36-B74F-57B4-9CD6-FCA87D987B89"><p>the database file is initially created</p> </li> <li id="GUID-4BA53AA2-0304-581A-AD48-2411C9986F69"><p>when an entry is created, it as added to the database</p> </li> <li id="GUID-70E72107-4ADE-5BF0-8199-C7B904CA72EB"><p>the program maintains an internal, non-persistent, copy of the indexes in the database file</p> </li> <li id="GUID-EB9EAF48-6D8A-5D6F-BC63-C2036FAC61D4"><p>when an entry is selected for display or editing, its data is retrieved from the database; all such entries’ data are maintained in an internal, non-persistent, form</p> </li> <li id="GUID-C455382A-F50F-5C92-B59B-A5E5FC966C93"><p>when an entry is edited and saved, just that single entry is replaced in the database</p> </li> <li id="GUID-3BE61AA6-BA20-577B-88AD-8798A12B9F52"><p>when the application exits, there is nothing to do to the database, since there should be no data that was not already saved (except, perhaps, the current entry if it was being edited)</p> </li> </ul> <p>Such an application never replaces the entire store. The database file itself is permanent; it is not erased when an entry is saved. Because of this, much more care is needed when maintaining this type of store. All links within the database must be maintained without corruption, and no stream subnetworks in the database should become inaccessible, otherwise space is wasted. The order in which streams are written to a permanent file store is not important as streams can be changed and rewritten. </p> <p>Overwriting an existing stream does not change its length. However, attempting to write beyond the end of the stream fails and results in a leave. Replacing a stream can result in a stream which is longer or shorter than the original.</p> <p>Note the difference between a persistent store (one that can be closed and re-opened), and a permanent file store (it is not replaced wholesale; rather, its individual entries are edited, inserted and deleted, but the store itself is permanent). A permanent file store is, of course, persistent.</p> <p>When the content of a permanent file store is naturally represented by a relational database, it is usually much more convenient to manipulate it using the relational database manager.</p> <p>Permanent file stores are encapsulated by the <codeph>CPermanentFileStore</codeph> class.</p> <section><title>See also</title> <p><xref href="GUID-C0414BDC-06FD-5E3C-93F7-DD3467CAA75E.dita#GUID-C0414BDC-06FD-5E3C-93F7-DD3467CAA75E/GUID-7CFECB38-1A52-5384-B9A7-2DAE624C1468">DBMS</xref> </p> </section> </conbody></concept>
    12 <concept id="GUID-C7FB54C4-43C9-562A-A18C-2818AF624774" xml:lang="en"><title>Permanent
       
    13 File Store</title><shortdesc>A permanent file store implements most of the operations defined
       
    14 by the store abstract framework. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    15 <p>Streams in a permanent file store can be:</p>
       
    16 <ul>
       
    17 <li id="GUID-5D731E0A-C4B7-56CE-AC27-25118A58506A"><p>overwritten</p> </li>
       
    18 <li id="GUID-13FF892F-8241-59A6-A39F-D0F2705F79A0"><p>replaced</p> </li>
       
    19 <li id="GUID-A8E9E699-6017-58FA-BC54-155B7838A172"><p>deleted</p> </li>
       
    20 <li id="GUID-95C70244-4BE3-5E20-83FA-1B1DCFB03F49"><p>created in advance of
       
    21 being written to.</p> </li>
       
    22 </ul>
       
    23 <p>A permanent file store is useful for the type of application which treats
       
    24 the data in the store as its prime copy. Typically, the object network comprising
       
    25 the application’s data is structured so that sections of data can be loaded
       
    26 in, and, if changed, written back to the store. Memory is used as a workplace
       
    27 for changing data. Such an application never replaces the entire store. This
       
    28 approach requires a sophisticated structure and greater sophistication within
       
    29 the application.</p>
       
    30 <p>Typically, a permanent file store is used by an application, such as a
       
    31 database, which maintains all its data in a file, but occasionally edits some
       
    32 entries in that database.</p>
       
    33 <p> In this paradigm:</p>
       
    34 <ul>
       
    35 <li id="GUID-56E7EE36-B74F-57B4-9CD6-FCA87D987B89"><p>the database file is
       
    36 initially created</p> </li>
       
    37 <li id="GUID-4BA53AA2-0304-581A-AD48-2411C9986F69"><p>when an entry is created,
       
    38 it as added to the database</p> </li>
       
    39 <li id="GUID-70E72107-4ADE-5BF0-8199-C7B904CA72EB"><p>the program maintains
       
    40 an internal, non-persistent, copy of the indexes in the database file</p> </li>
       
    41 <li id="GUID-EB9EAF48-6D8A-5D6F-BC63-C2036FAC61D4"><p>when an entry is selected
       
    42 for display or editing, its data is retrieved from the database; all such
       
    43 entries’ data are maintained in an internal, non-persistent, form</p> </li>
       
    44 <li id="GUID-C455382A-F50F-5C92-B59B-A5E5FC966C93"><p>when an entry is edited
       
    45 and saved, just that single entry is replaced in the database</p> </li>
       
    46 <li id="GUID-3BE61AA6-BA20-577B-88AD-8798A12B9F52"><p>when the application
       
    47 exits, there is nothing to do to the database, since there should be no data
       
    48 that was not already saved (except, perhaps, the current entry if it was being
       
    49 edited)</p> </li>
       
    50 </ul>
       
    51 <p>Such an application never replaces the entire store. The database file
       
    52 itself is permanent; it is not erased when an entry is saved. Because of this,
       
    53 much more care is needed when maintaining this type of store. All links within
       
    54 the database must be maintained without corruption, and no stream subnetworks
       
    55 in the database should become inaccessible, otherwise space is wasted. The
       
    56 order in which streams are written to a permanent file store is not important
       
    57 as streams can be changed and rewritten. </p>
       
    58 <p>Overwriting an existing stream does not change its length. However, attempting
       
    59 to write beyond the end of the stream fails and results in a leave. Replacing
       
    60 a stream can result in a stream which is longer or shorter than the original.</p>
       
    61 <p>Note the difference between a persistent store (one that can be closed
       
    62 and re-opened), and a permanent file store (it is not replaced wholesale;
       
    63 rather, its individual entries are edited, inserted and deleted, but the store
       
    64 itself is permanent). A permanent file store is, of course, persistent.</p>
       
    65 <p>When the content of a permanent file store is naturally represented by
       
    66 a relational database, it is usually much more convenient to manipulate it
       
    67 using the relational database manager.</p>
       
    68 <p>Permanent file stores are encapsulated by the <codeph>CPermanentFileStore</codeph> class.</p>
       
    69 </conbody><related-links>
       
    70 <link href="GUID-C0414BDC-06FD-5E3C-93F7-DD3467CAA75E.dita"><linktext>DBMS</linktext>
       
    71 </link>
       
    72 </related-links></concept>