mercredi 29 juillet 2015

Database Poller Java EE/Spring/Hibernate

I am using Java EE with the Spring Framework and Hibernate. I want to write a very simple database poller that does the following

  1. Poll the DB every second
  2. If a certain column in a certain row has the value that I want, stop polling and return success.
  3. If polling has gone on for 10 or more seconds, return failure

I have already looked into Java's ScheduledExecutorService and ExecutorService, and I think that I may be able to do what I want with these. My question is, is there something built into Spring/Hibernate that can do this more elegantly?

Aucun commentaire:

Enregistrer un commentaire