开发者

How to set a global clock in a servlet container to check expiration date in database

I'm developing this website which works like a kind of auction for specific kind of items. The website will be developed using pure jsp and servlets. Basically the items that the sellers will post on the site have an expiry date, after that date "1 minute after midnight of the selected expiry date" the product will be assigned to the highest offering user or registered as unsold. The items will be stored in a MySQL database with a Date column. I need to find a way to automatically find out when an auction for an item is expired, i was thinking of a Timer object within the servlet container that every day one minute after midnight sends a query to the DB to check which aucti开发者_StackOverflow中文版on is expired and to take an action accordingly. Before to start working on it i wanted to check rather there are better "known" options. Any idea? Thank you


Quartz Scheduler are better suited.

Quartz is a full-featured, open source job scheduling service that can be integrated with, or used along side virtually any Java EE or Java SE application - from the smallest stand-alone application to the largest e-commerce system. Quartz can be used to create simple or complex schedules for executing tens, hundreds, or even tens-of-thousands of jobs; jobs whose tasks are defined as standard Java components that may execute virtually anything you may program them to do. The Quartz Scheduler includes many enterprise-class features, such as JTA transactions and clustering.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜