This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
master stewards:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
garden masters:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
gardeners:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

work with spring mvc and quartz scheduler with a oracle database

 
pioneer
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i'm working in a spring mvc project and i using quartz to schedule a task that send a email between a start date and end date with some frequency defined by the user in the user interface, i was thinking on doing a mtehod with the start date, end date and frequency as a parameter and call this method from a controller when the user click the button send email, then i want to create a table in my database that save that task with a unique id and another field that says if this task is active or not, if there is a crash in my application, when i restarted my web application is going to do a query in my Task table and bring me all my task that are active and return this tasks then i will save them in an arrraylist and then execute them. I want to know if this is a good aproach to do this requeriment thanks in advance
 
pioneer
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quartz can persist the jobs in the database, with this Quartz is going to handle the misfires, application restarts and allows you to have control like pause and resume the jobs also.
 
Jhon Parker
pioneer
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Prasad Krishnegowda wrote:Quartz can persist the jobs in the database, with this Quartz is going to handle the misfires, application restarts and allows you to have control like pause and resume the jobs also.



i'm using oracle 11g to do my application, but what do you mean that quartz does it? do you mean that i dont need to create tables to do this?? i was thinking of this approach since the users need a list of all the scheduled emails that they created, but is my approach ok??
 
Prasad Krishnegowda
pioneer
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can very well create the tables to store the data and show the user list of scheduled emails.

What i meant was, when the application restarts there is no need for you to query these jobs again from the table and re-execute them, quartz has persistent jobs feature, where quartz can automatically pickup the jobs which were running before the application stopped and continue executing them on regular intervals as before. In this aproach, quartz requires to have few tables created, the schemas and the approach are available on the quartz site, so i would suggest you look at that feature once.
 
Jhon Parker
pioneer
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there anyway to keep track of my jobs running in quartz without having to do a query in the table i created to save them?
 
Prasad Krishnegowda
pioneer
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can get it, if you are using Quartz 2.1.5, you can use the below code..
 
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!