This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Grokking Bitcoin and have Kalle Rosenbaum on-line!
See this thread for details.
Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization 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
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Check the value of colum at regular interval to get the desired value  RSS feed

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following method (processFebMessage) in my class and basically, I am sending message parameter obtained form the JMSListner to the sendMessage method
to retrieve the value of `REQUEST_STATUS` from the emp.data_request table as shown in the RequestDaoImpl class below.

The different `REQUEST_STATUS` values are RUNNING, COMPLETE, ERRONEOUS

AS soon as I rung my application, I could see the status RUNNING but after sometime it changes to COMPLETE.

I am wondering what's the best approach to keep on checking the status from the table again and again ? I want to do some operations
as soon as I get `COMPLETE`.



RequestDao



RequestDaoImpl:

 
Greenhorn
Posts: 17
Java Linux
 
Jack Tauson
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

SaurabhRc Jain wrote:You can use Spring scheduler :

https://spring.io/guides/gs/scheduling-tasks/



Can you elaborate more on this, how it is going to fit in my situation?
 
SaurabhRc Jain
Greenhorn
Posts: 17
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are few things not specified in your post:
  • Which process is inserting data in data_request table?
  • Which process is updating the status to COMPLETE in data_request table?


  • Assuming that the status is marked as COMPLETE by an asynch process. And you don't have any information on when that happens.

    Create another table 'request_process' to maintain the process_status.
    In method processFebMessage(), insert a record in 'request_process' with process_status as NEW.

    Create a scheduler to run periodically:
  • Lookup records in 'request_process' table in NEW process_status
  • Check the REQUEST_STATUS from data_request table
  • For COMPLETE case, do whatever you need to do and mark DONE in 'request_process' table


  • Another approach could be that scheduler simply looks up all records in COMPLETE REQUEST_STATUS without the need of additional table 'request_process'.

    If you can provide details about your project requirement & design, then we can think of a simpler solution.


     
    I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
    Create Edit Print & Convert PDF Using Free API with Java
    https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!