11. The treatment of the bases#
Some operations deal with databases JEVEUX in their entirety, they are essential to initiate the memory management system, but are also used at the end of the process. Attention, the content of the databases is systematically enriched during the execution of the Aster POURSUITE command, and it is essential to finish the execution with the FIN command in order to properly close the direct access files. Only a stop with a UTMESS message like this <S>allows SUPERVISEUR to validate the concepts created and to properly close the direct access files by calling the JEFINI routine.
The opening of a base
The length of the records in the direct access file and the initial length of the name directory remain the only adjustable parameters associated with databases JEVEUX. They are specified when calling routine JEINIF, the status of the database is also indicated at the start of work to possibly reopen an existing file, the status at the end of the work makes it possible to avoid superfluous inputs/outputs if the database is not maintained. Reopening a database (command POURSUITE in Code_Aster or reading the catalog of compiled elements) requires knowledge of the length of the records in the direct access file and the content of certain system objects, the first record contains the data essential to reconstitute this various information. The routine JXLIR1 is responsible for rereading the start of the first recording: we open the direct access file (with an index whose size is set to 11), we read the information at the beginning of the recording, then we close the file. You can then open the direct access file with an index array of suitable length, and reread the contents of the system objects stored on disk during the previous execution.
The closure of a base
The operation to close a database, carried out by routine JELIBF, consists in freeing all the objects attached to it, possibly writing to disk and in updating the system objects. Two loops are required to release objects: the first one treats collections, the second one treats simple objects. The system objects are then unloaded, the disk addresses are processed last, the input/output buffers are emptied, and finally the characteristics of the database are updated based on the first record. The direct access file is then closed by calling routine JXFERM.
The resetting of a base
During object destruction operations JEVEUX, the associated disk space is marked free but is not systematically recovered. Retaging allows you to « fill » the gaps by « reassembling » the recordings. It is therefore necessary to modify the disk address attribute of the objects contained in the records to be moved. This operation is immediate for simple objects, concerning collections you must have access to the system object containing the disk addresses (which itself can be located the record to be moved!). There is no reorganization within the records containing images of small objects. The JETASS routine is used and the « JETASS » variant of the release routine JJLIDE is used. This utility can be directly called by the FIN command in the*Code_Aster*.
Copying the basics
This operation must be performed to effectively take into account the resetting, as the WRITDR direct access files cannot be reduced in place. Routine JXCOPY works from closed bases and returns them in the same state. This utility can be called by the FIN command in the*Code_Aster*.