title: Getting Older timestamp from query
body: <p>Below is my method to fetch current database time using select query.</p>
  
  <pre><code>public Date getDBDateTime() { 
      Session session = sessionFactory.getCurrentSession();   
      return (Date) session.createSQLQuery("select now() as date").uniqueResult();    
  }
  </code></pre>
  
  <p>this method returns the current timestamp from database but once in a while this method returns older timestamp from db. (sometimes 30s to 1 min old)</p>
  
  <p>here is my service layer method in spring which calls above dao method.</p>
  
  <pre><code>@Transactional
  public void doSomething(){
     Date now  = dao.getDBDateTime();
     //service specific logic
  }
  </code></pre>
  
  <p>need to select db time for some event timing calculation and to have db and app servers decoupled from same time-zone.</p>
  
  <p>can anyone point me where am i going wrong and suggestions to fix it ?</p>
  
  <p>Thanks in anticipation !</p>