title: hibernate - uniqueResult silently fails
body: <p>I have a login controller that use the hibernate uniqueResult method. Everything works fine when i test it in eclipse's tomcat server. But when i deploy my webapps to tomcat server (on the same machine) it fails: it always returns null even i use the correct credential.</p>
  
  <p>Here is my hibernate code:</p>
  
  <pre><code>session.createCriteria(User.class)
              .add(Restrictions.eq(User.USERNAME_FIELD, userName))
              .add(Restrictions.eq(User.PASSWORD_FIELD, password)).uniqueResult();
  </code></pre>
  
  <p>Thank you!</p>