Reporting Server/At Runtime Topics
In production the data loader application will run periodically. The log will show statements like this:
[loadData] 2019-12-11 11:21:17,299 [pool-2-thread-3] INFO org.openbravo.reporting.tools.dataloader.BaseDataLoader - product_category --> loaded + committed in 0 seconds [loadData] 2019-12-11 11:21:17,300 [pool-2-thread-3] INFO org.openbravo.reporting.tools.dataloader.BaseDataLoader - bpartner --> Start of load data [loadData] 2019-12-11 11:21:17,302 [pool-2-thread-2] INFO org.openbravo.reporting.tools.dataloader.PostgresInsertStatementHelper - POS TouchPoint --> Reindexing table took 0 seconds [loadData] 2019-12-11 11:21:17,308 [pool-2-thread-2] INFO org.openbravo.reporting.tools.dataloader.BaseDataLoader - POS TouchPoint --> loaded + committed in 0 seconds [loadData] 2019-12-11 11:21:17,309 [pool-2-thread-2] INFO org.openbravo.reporting.tools.dataloader.BaseDataLoader - sales order lines --> Start of load data [loadData] 2019-12-11 11:21:17,323 [pool-2-thread-3] INFO org.openbravo.reporting.tools.dataloader.StandardDataLoader - bpartner --> before commit, loading 24 records took 0 seconds [loadData] 2019-12-11 11:21:17,327 [pool-2-thread-3] INFO org.openbravo.reporting.tools.dataloader.BaseDataLoader - bpartner --> loaded + committed in 0 seconds
The name of the load step is printed first with the relevant message. Note that the data loader application runs script tasks in parallel, log statements of parallel tasks are intertwined.
The obrpttl_parameters table
The obrpttl_parameters table is an important table. When a script is run a record is created or updated in that table. The record has two columns name and timestamp_value. The name corresponds to the load step. The timestamp value is the last time that script ran minus 5 minutes. The 5 minutes is subtracted for detailed reasons to make sure that data is not missed when doing incremental loads.
The parameters record has two important purposes:
- for scripts which have 'Execute Once' checked, the existence of a record in the obrtpttl_parameters table means that the script has already run and it won't be run again.
- for incremental load scripts with updatedFrom and updatedTo parameters the timestamp is used at the next load as the value for the updatedFrom parameter (updatedTo is always now minus 5 minutes).
Force reload-full or reload-from or re-execute an execute-once script
So with this purpose of the obrtpttl_parameters table there are several things which can be achieved by updating the obrpttl_parameters table directly:
- full reload: by removing the relevant record from the obrpttl_parameters table the related script will do a full reload of data at the next run.
- execute again: say you have a script that already ready once and should in general only run once. However for some reason you want to run it again (because it failed for some reason). Then to accomplish this, just remove the related record from the obrpttl_parameters table.
- load-from: say that for a specific table or script you want to load the data from some specific timestamp. To achieve this, update the timestamp value for the relevant record, set it to your required load-from timestamp. At the next run the data will be reread from that new timestamp.