Subject AW: [firebird-support] firebird and a temporary data
Author Steffen Heil
Hi

You can track the current_timestamp with each record inserted.
Then you can create a view that you use instead of that table that gets its
content from a stored procedure, that on its own first removes every "old"
record and then dumps the remaining rows.

This will keep records in the database longer than required but they will be
cleared during next access and you will never incorrectly seen them in your
application.

Two more hints:
- Call the cleanup-code before any backup.
- I am not sure, but I think I remember that current_timestamp is fixed
during a transaction. [Anyone correct my, if I am wrong, please.] So your
timeout shoud be something like the time you want to keep the data + the
duration of the longest expected transaction.

Regards,
Steffen


> -----Urspr√ľngliche Nachricht-----
> Von: firebird-support@yahoogroups.com [mailto:firebird-
> support@yahoogroups.com] Im Auftrag von ik
> Gesendet: Montag, 24. Mai 2010 14:16
> An: firebird-support@yahoogroups.com
> Betreff: [firebird-support] firebird and a temporary data
>
> Hello list,
>
> I have a requirement to save data that will be shared by few processes for
an
> X amount of time, like 5 minutes or 20 minutes etc...
> Because I use Firebird on this project, and it can help me also remove
some
> race condition on such information I'm saving, I wish to create a table
for it in
> the database.
>
> Is there a way in Firebird to tell it to store information only for
specific
> amount of time (the table should remain, but not the content), so every X
> amount of time from insert it will delete all of the data that are 5
minutes old
> and older, or should I create a kind of daemon in Linux for it and do it
outside
> ?
>
> Thanks,
> Ido
> http://ik.homelinux.org/
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item on the main
> (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++
> Yahoo! Groups Links
>
>
>

[Non-text portions of this message have been removed]