Das
Das

Reputation: 87

An event to raise after 24 hours of time in db in struts application

In my struts application tickets are being raised and they are stored in db with time of creation .

Now my requirement is to raise a event after 24 hours of that token created time.

I am aware of a Quatz schedular which can raised an event for every 24 hr. But my requirement is based on the time in some row of the db.

Can I find any tool such as above to do this?

How to do it with minimum hits to data base?

Please can some one suggest me some ideas? I am using the MYSQL may be needed to answer.

Upvotes: 3

Views: 118

Answers (1)

Vikdor
Vikdor

Reputation: 24134

In one of previous projects, we used to have reminders configured by user to be fired arbitrarily,

  • based on the due date of a project,
  • at some point in future
  • based on the inactive period of a project etc.,

We used to have a Quartz Job that would run every 5minutes and identify the project records in the database that satisfy one of the above criteria and retrieve them and perform an action (in our case, we needed to send a reminder email to some recipients configured).

Based on your requirement, you can configure a similar job and decide on the periodicity. If your table is too large, you can run the job every 5min/10min which means the event might be raised later than 24 hours by a 5min/10min delay. If your table is small enough, you can run the job every minute.

HTH.

Upvotes: 1

Related Questions