You are not logged in.
Pages: 1
Hello again,
Questions about history:
1. How to delete some history records?
2. If TSQLRecord was deleted from database, how I can determine it ID to get history for this record?
3. If database was opened first to store 100 rows, after this if I open it to store 10 rows in history
what occured with previously saved records, if they count already more than 10?
4. This is possible to change history depth on the fly for database?
5. This is possible to clear history depth for whole database for example up to 10 history item per record?
6. Not actual for me now, but for the future: if I add property in my TSQLRecord than I lost all previous history?
How to prevent this? How to store this history manually before I will lost it?
Offline
1. Work directly on the history table, via regular ORM commands.
2. There is a flag stored in the history table for deleted records.
But you have to write a manual query yet in the history table to retrieve deleted IDs.
In fact, I suspect this ID would most probably be stored elsewhere in your database.
3. I do not understand the question, sorry.
4. Yes, AFAIK TSQLRestServer.TrackChanges() works on the fly.
But be aware not to disable then renable it, since history data may become inconsistent (as written in the method doc).
5. There is no such method for this yet - see point 1.
6. In current implementation, yes, TSQLRecordHistory.HistoryOpen() will just void any previous stored history, if the TSQLRecord layout changed (e.g. fields added or renamed).
This is due to the fact that the stored BLOB binary data is optimized for size and speed, so the field layout is expected to be fixed, and matching the current TSQLRecord.
I suspect that you can define a new history table for the updated TSQLRecord, then use the older history table for the previous content... Perhaps not very convenient...
Offline
Question 3 is about if I setup TrackChanges to 100 history depth, and after this to 10 depht.
In this situation if I change record wich have more than 10 records in history, will be deleted all except last 10?
Offline
Hi again, this idea can be implemented?
Also I need functionality to store in history the user name, which perform corresponding operation
where the right place to put this code?
Edit: or similar question - how to determine session (and user name) from OnUpdateEvent
Last edited by EgorovAlex (2015-03-10 16:09:24)
Offline
Pages: 1