Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timer objects to Firebird database [CORE1717] #2142

Closed
firebird-automations opened this issue Jan 31, 2008 · 10 comments
Closed

Add timer objects to Firebird database [CORE1717] #2142

firebird-automations opened this issue Jan 31, 2008 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @livius2

Is duplicated by CORE4012
Is duplicated by CORE4052
Duplicates CORE1613
Duplicates CORE743

Votes: 2

Add posibility to create timer objects - working like procedure and fire at specified time or interval
this can change some client applications to very "thin clients"
and i suppose many people can find better example of use

simple example :
create Timer DeleteOldData RUN_AT 12:30
as
BEGIN
DELETE FROM SOME_TABLE WHERE DATE_INSERT<CAST('now' AS DATE) - 30;
END;

create Timer DeleteOldData RUN_INTERVAL 60*1000
as
DECLARE VARIABLE VAR_ID INTEGER;
DECLARE VARIABLE VAR_NAME VARCAHR(40);
DECLARE VARIABLE VAR_DT TIMESTAMP;
BEGIN
FOR SELECT
ID, NAME, DT
FROM
BUFFER
INTO :VAR_ID, :VAR_NAME, :VAR_DT
DO
BEGIN
UPDATE SOMETABLE SET LAST_ACCES=:VAR_DT WHERE NAME=:VAR_NAME;
DELETE FROM BUFFER WHERE ID=:VAR_ID;
END;
END;

@firebird-automations
Copy link
Collaborator Author

Modified by: @livius2

description: Add posibility to create timer objects - working like procedure and fire at specified time or interval
this can change some client applications to very "thin clients"
and i suppose many people can find better example of use

simple example :
create Timer DeleteOldData RUN_AT 12:30
as
BEGIN
DELETE FROM SOME_TABLE WHERE DATE_INSERT<CAST('now' AS TIMESTAMP) - 30;
END;

create Timer DeleteOldData RUN_INTERVAL 60*1000
as
DECLARE VARIABLE VAR_ID INTEGER;
DECLARE VARIABLE VAR_NAME VARCAHR(40);
DECLARE VARIABLE VAR_DT TIMESTAMP;
BEGIN
FOR SELECT
ID, NAME, DT
FROM
BUFFER
INTO :VAR_ID, :VAR_NAME, :VAR_DT
DO
BEGIN
UPDATE SOMETABLE SET LAST_ACCES=:VAR_DT WHERE NAME=:VAR_NAME;
DELETE FROM BUFFER WHERE ID=:VAR_ID;
END;
END;

=>

Add posibility to create timer objects - working like procedure and fire at specified time or interval
this can change some client applications to very "thin clients"
and i suppose many people can find better example of use

simple example :
create Timer DeleteOldData RUN_AT 12:30
as
BEGIN
DELETE FROM SOME_TABLE WHERE DATE_INSERT<CAST('now' AS DATE) - 30;
END;

create Timer DeleteOldData RUN_INTERVAL 60*1000
as
DECLARE VARIABLE VAR_ID INTEGER;
DECLARE VARIABLE VAR_NAME VARCAHR(40);
DECLARE VARIABLE VAR_DT TIMESTAMP;
BEGIN
FOR SELECT
ID, NAME, DT
FROM
BUFFER
INTO :VAR_ID, :VAR_NAME, :VAR_DT
DO
BEGIN
UPDATE SOMETABLE SET LAST_ACCES=:VAR_DT WHERE NAME=:VAR_NAME;
DELETE FROM BUFFER WHERE ID=:VAR_ID;
END;
END;

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

We already have a feature request for jobs: CORE743. Isn't it more flexible?

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

That core-743 is suppose is proposition of external sheduler to run some tasks
and this is good but i suppose that timer objects created in database also will be useful
becaouse when we move database this obiects go with database
but with external sheduler - moving databese is = lost of sheduled task on it

@firebird-automations
Copy link
Collaborator Author

Commented by: Homer Jones (homerjones)

This would be a great benefit for procedures that must be run once a day without user intervention. Client side task scheduling is dependent on the accuracy of the system clock, which users often change by accident. Moreover, in a multi-user environment, heroic logic must be put into play to assure a procedure is run only once, but always run each day (or week, or month, etc). It is a better bet to rely on the single clock of the server, than multiple clocks in a mult-user setup. The more we can do on the server, the more reliable applications become.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

Link: This issue is duplicated by CORE4012 [ CORE4012 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue is duplicated by CORE4052 [ CORE4052 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue duplicates CORE1613 [ CORE1613 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue duplicates CORE743 [ CORE743 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant