%SYS
Journal Class Reference

This class allows you to modify and view the [Journal] section of the CPF file through programatic APIs. More...

Inheritance diagram for Journal:
Collaboration diagram for Journal:

Static Public Member Functions

_.Library.Integer TranslateTime (_.Library.Integer TimeValue, _.Library.Integer ScaleFactor)
 TimeValue: in seconds
More...
 
- Static Public Member Functions inherited from CommonSingleMethods
_.Library.Status Get (_.Library.String Properties, _.Library.String CPFFile, _.Library.Integer Flags)
 Get a sections properties from a CPF file. More...
 
_.Library.Status GetList (_.Library.String CPFFile, _.Library.Integer Flags)
 Returns the properties from a section in a CPF file by value in $list format
More...
 
_.Library.Status Modify (_.Library.String Properties, _.Library.String CPFFile, _.Library.Integer Flags)
 Modify a sections properties in a CPF file. More...
 
_.Library.ObjectHandle Open (_.Library.String CPFFile, _.Library.Integer concurrency, _.Library.Status Status, _.Library.Integer Flags)
 Open an instance of an section object in a CPF file. More...
 

Public Attributes

 AlternateDirectory
 Alternate journal directory. More...
 
 ArchiveName
 The destination for archiving journal files, given as the name of an archive target defined in the [Archives] section. More...
 
 BackupsBeforePurge
 Number of backups before the journal files (or the archived copies) are automatically purged. More...
 
 CurrentDirectory
 Primary journal directory. More...
 
 DaysBeforePurge
 Number of days before the journal files are purged. More...
 
 FileSizeLimit
 Maximum size of each journal file in MB. More...
 
 FreezeOnError
 Freeze the system if there is an error writing to the journal. More...
 
 JournalFilePrefix
 Prefixes journal file names with this string. More...
 
 JournalcspSession
 cspSession global will be mapped to the TEMP database and not journaled. More...
 
 PurgeArchived
 Whether to purge journal files as soon as they are copied to archive. More...
 
- Public Attributes inherited from CommonProperties
 CPFFile
 CPF file which the object maps to. More...
 
 Comments
 Embedded comments in the CPF file. More...
 
 Flags
 Flags governing how the object is processed when Save() is called. More...
 
 Name
 Name of the object instance. More...
 

Static Public Attributes

 NOTRANSACTIONS = None
 Setting this flag keeps the journal updates outside of a transaction. More...
 
- Static Public Attributes inherited from CommonProperties
 DOMAIN = None
 This class contains properties which are included by classes which manipulate sections in the CPF file. More...
 

Detailed Description

This class allows you to modify and view the [Journal] section of the CPF file through programatic APIs.

While properties are usually modified through the System Management portal, there may be some occasion where modifying them through the API's is best for your system. In all the Config methods, if you do not specify the CPFFile parameter, the currently active CPF file is used. If you wish to modify a CPF file which is not the currently active one, then specify the CPFFile you wish to modify in the method call.
The Flags parameter does not normally need to be specified; the defaults are usually sufficient for most cases.
You can use the provided API's (Get/Modify) to modify the properties by passing in the correct parameters.

NOTE: You cannot use object syntax to directly modify the [Journal] parameters. You MUST use the API's found in this class.

EXAMPLE:

    ; Use class methods to modify properties
    SYS>s Status=##Class(Config.Journal).Get(.Properties)
    SYS>i 'Status w !,"Error="_$SYSTEM.Status.GetErrorText(Status)
    SYS>zw Properties
    Properties("AlternateDirectory")="C:\AppDB1\Mgr\Journal\"
    Properties("ArchiveName")=""
    Properties("BackupsBeforePurge")=2
    Properties("CurrentDirectory")="C:\AppDB1\Mgr\Journal\"
    Properties("CompressFiles")=1
    Properties("DaysBeforePurge")=2
    Properties("FileSizeLimit")=2048
    Properties("FreezeOnError")=0
    Properties("JournalFilePrefix")=""
    Properties("JournalcspSession")=1
    Properties("PurgeArchived")=0
    SYS>s Properties("FileSizeLimit")=1024
    SYS>s Status=##Class(Config.Journal).Modify(.Properties)
    SYS>i 'Status w !,"Error="_$SYSTEM.Status.GetErrorText(Status)
    

Member Function Documentation

◆ TranslateTime()

_.Library.Integer TranslateTime ( _.Library.Integer  TimeValue,
_.Library.Integer  ScaleFactor 
)
static

TimeValue: in seconds

Returned value: in seconds, minutes, hours or days, whichever is the largest unit that makes the returned value a whole number.
ScaleFactor: Returned value * ScaleFactor = TimeValue

Member Data Documentation

◆ NOTRANSACTIONS

NOTRANSACTIONS = None
static

Setting this flag keeps the journal updates outside of a transaction.

When Save() is called in the API's.

◆ AlternateDirectory

AlternateDirectory

Alternate journal directory.


 

◆ ArchiveName

ArchiveName

The destination for archiving journal files, given as the name of an archive target defined in the [Archives] section.


 

◆ BackupsBeforePurge

BackupsBeforePurge

Number of backups before the journal files (or the archived copies) are automatically purged.


 

◆ CurrentDirectory

CurrentDirectory

Primary journal directory.


 

◆ DaysBeforePurge

DaysBeforePurge

Number of days before the journal files are purged.


 

◆ FileSizeLimit

FileSizeLimit

Maximum size of each journal file in MB.


 

◆ FreezeOnError

FreezeOnError

Freeze the system if there is an error writing to the journal.


If this option is set to true (1), as soon as the error occurs all global activities that are normally journaled are blocked, which causes other jobs to block. The typical outcome is that the system goes into a hang state until the journaling problem is resolved, and then resumes running. While InterSystems IRIS is hanging, the administrator can take corrective measures, such as freeing up space on a disk that is full, switching the journal to a new disk, etc. This option has the advantage that once the problem is fixed and InterSystems IRIS resumes running, no journal information has been lost. It has the disadvantage that the system is less available while the problem is being solved.
If this option is set to false (0), when a journaling error occurs journaling is entirely disabled, while the system continues running as normal. The system sends a console message to alert the administrator, who can fix the problem and then run ^JRNSWTCH at the console to restart journaling.  

◆ JournalFilePrefix

JournalFilePrefix

Prefixes journal file names with this string.


May be used to distinguish journal files from different instances in the same directory.
 

◆ JournalcspSession

JournalcspSession

cspSession global will be mapped to the TEMP database and not journaled.


 

◆ PurgeArchived

PurgeArchived

Whether to purge journal files as soon as they are copied to archive.


Note that purging never occur if files are needed by the system (for crash recovery, mirroring, etc.)