we have implemented some timer-based queries to find out if the user has modified the table of a database. Example is a a taskbar where the user can see all of his daily tasks. Every 60 seconds this taskbar is updated/refreshed automatically. To avoid a huge SELECT of all the referenced tables which lasts some seconds (= customer is annoyed by an hourglass), we would like to have something like an "last_user_update" information of a database table which is updated automatically by the database after each update/delete/insert.
Example: SELECT last_user_update FROM tasks
If the table has been updated, we would go on with the refresh. If not, we would have no further delay/hourglass. I know that TD-7 has multithreading, but nevertheless in some cases this database feature would be helpful.
Uwe van der Horst
That's a nice request, but I think that Development would reject it, simply because of the locking problems that could occur to update that one item in one of the system tables every time someone does an update to a table. This could be a huge overhead (and possibly cause more hourglasses).
I think you should be able to do this using a trigger, i.e. an 'after update on tasks' where you update a specific record indicating who the last updater was. Do this for critical tables and then you can select from that row to see if the user matches.
Would that be a possibility?
Hi Mike, thank you for your quick answer. THIS is the way we are already doing thismvandine wrote:I think you should be able to do this using a trigger, i.e. an 'after update on tasks' where you update a specific record indicating who the last updater was. Do this for critical tables and then you can select from that row to see if the user matches.
It works perfect. The only thing is that we must delete the trigger before changing the database structure when releasing a new version (i.e. from within our setup) and create it again after the setup is finished. But it is ok for us, that was just an idea.
Uwe van der Horst
Who is online
Users browsing this forum: [Ccbot] and 0 guests