Getting Object Access Information

The System class provides methods that enable you to retrieve information about the access of objects. Access counts for classes are held on the database server node, and are incremented every time an instance of that class or one of its subobjects is written to the database or fetched from the database. Persistent object accesses only are counted.

The access counts do not directly indicate how many times applications have used objects. If an object resides in the persistent object cache, it may not have to be fetched from the database when used. The access counts reflect database activity, rather than application activity.

When dealing with classes, the class number can be retrieved using the number property of the Class class, and the class with a particular number can be found using the getClassByNumber method of the Schema class.

To reduce any overhead caused by maintaining class access frequency statistics, the Process class provides methods that enable you to turn class access frequency counters on and off and to query the status of classes access frequency statistics, including the UTC time at which the recording of process counters were enabled.

JADE maintains a list of the processes that have class access frequency counters enabled. When a process requests the disabling of class access frequency statistics, the process is removed from the list. Statistics are disabled only when no processes remain in the list. If a process terminates without having turned class access frequency statistics disabled, the process is removed from the list and statistics are turned off if there are no other processes in the list. For details, see the following subsections.