Transaction Purging

Transactional data which is older than N number of days(based on LMD(Last Modified Date)) will be purged.  A TB WF(Table Workflow) called "PurgeTransactionTables" runs every day at 2A.M. and purges the transactional data. For this Workflow to run, you need to add data to ExternalReference. The data added into ExternalReference defines all the modules where the transactional data needs to be purged.

FieldValue
REF_TYPE PLT.ModelPurge or PLT.ModelAuditPurge
EXTERNAL_VALUEModelType
LOCAL_VALUERetention Period(in days)

For example, if you need to purge the Alert table and the keep the data only for 6 months that is 180 days, then you need to add the data as:

FieldValue
REF_TYPE PLT.ModelPurge
EXTERNAL_VALUEAlert
LOCAL_VALUE180

You can add additional purge criteria, like only purge if (state= 'Cancelled' or state='Closed'). To add additional purge criteria, you can register the fragment using com.transcendsys.platform.server.purge.ModelPurgeRegistry class using ModelContextListener

com.transcendsys.platform.server.purge.ModelPurgeRegistry.register(Alert.MODEL_TYPE, "state in ('Cancelled','Closed')");

Along with additional purge criteria, you can also define:

  • Commit chunk size using ExternalReference. Default value of commit chunk size is 1000.     

    FieldValue
    REF_TYPEPLT.PurgeTransactionLog
    EXTERNAL_VALUEChunkSize
    LOCAL_VALUEchunk size value
  • PROC_LOG Threshold size. Default threshold log value is 5000
    1. The PROC_LOG table is used to add log from procedure for later analysis or for error reporting. For example: "1000 rows successfully deleted from table ALERT" or "Purging of Alert table is failed because of such and such error"
    2. Based on the set threshold value,  the table is auto purged and PLT will not log any more records to the PROC_LOG. For example: "Logging Threshold reached for table ALERT. No more errors will be logged for this"
      FieldValue
      REF_TYPEPLT.PurgeTransactionLog
      EXTERNAL_VALUEProcLogThreshold
      LOCAL_VALUEthreshold value, i.e. 5000 
    3. To run the PROC_LOG manually:

      BEGIN
          PURGE_TRANSACTIONS('ALERT', 'SYS_ALERT_ID', 20, '1=1', 100, 1000, 5000);
      END;

      Parameter Table:

      FieldValue
      Table NameALERT
      Surrogate Key

      SYS_ALERT_ID

      Retention(in days)180 (This means proc will delete all records from ALERT Table which are older than 180 days)
      Additional Query Fragment
      Instance Value ChainID 9495
      ChunkSize1000
      Log Threshold value5000
    4. To monitor the execution of PROC_LOG table:

      SELECT * FROM PROC_LOG;