- 01 Apr 2024
- 1 Minute to read
- Print
- DarkLight
- PDF
Auto Archive Transaction details at a specified time
- Updated on 01 Apr 2024
- 1 Minute to read
- Print
- DarkLight
- PDF
Problem:
How to Auto Archive Transaction details at a specified time.
Solution:
How the Auto Archiving feature works:
Every 10 minutes or so the a background thread in Pharos Database Server makes call to the Database to confirm the license details. At the same time the background thread checks the registry on the local machine to find out when it last ran the AutoArchive routine.
If more than 24 hours has passed since the last AutoArchive, then the AutoArchive routine is run again. The AutoArchive routine makes series of stored procedure calls to the database to archive/purge the transactions and at the same time remove any "express" patrons that may be lingering in the system.
The stored procedure to reset the computer transactions so that the associated user is blanked out takes the current date when the stored procedure is run, rolls back to midnight on the previous day, and resets the transactions that were recorded before this date/time. If the stored procedure is called at 23:59:00 on 2003-05-13, then transactions that occurred before 00:00:00 on 2003-05-12 will be reset. There will be transactions that are more than 24 hours old, but there should not be any transactions that are more than 48 hours old.
When Pharos Database Server has finished the AutoArchive routine, it will update the registry with the current time.
In Pharos 6.1 and later, a registry key is available to determine when the AutoArchive routine will run. Create a DWORD value called "AutoPurgeTime" at:
HKEY_LOCAL_MACHINE\SOFTWARE\Pharos\Database Server
This value specifies the number of minutes after midnight that the AutoArchive routine will run.
Prior to Pharos 6.1, the time when the AutoArchive runs is not configurable, but depends on a value in the registry, which will typically correspond to the time when the Pharos Database Server was first started and first attempted to run the AutoArchive routine.
If the site requires all the transactions for the previous day to be autoarchived and the user names reset at a specific time you can do the following:
Open registry editor and find [HKEY_LOCAL_MACHINE\SOFTWARE\Pharos\Database Server] "AutoArchiveTime", set it to blank.
Export this registry key with the name reset.reg.
Create a batch file with the following command in it:
regedit /s d:\reset.reg
(Make sure that you specify correct path and file name for reset.reg)
Set scheduled tasks to run the batch file at the desired time.