Successful implementation of user online or not <p>I have a Java EE 7 application with Spring MVC, which is a web service for mobile application as a final school project. I attribute a Calendar for the last request received and Boolean "Online" for each user. So here's my problem implementer how well a system will change the attribute of the user in my DB if the web service no longer get from the user's request after X minutes?</p> <p>I need to make a class that implements Runnable and make an infinite loop on my DB looking the Online User and compares how long that has made a request?</p> <p>If the answer is yes how to do a method that is still running?</p> <p>Sorry for my english I'm not English.</p>