title: org.hibernate.QueryException: Not all named parameters have been set:[]
body: <p>I'm getting extremely strange behavior out of JPA 2.0 </p>
  
  <p>I'm trying to build a query that looks likes, where employeId and empDepartment are long values passing through java arguments</p>
  
  <pre><code>Query query=em.createQuery("SELECT e FROM Employee e WHERE e.empId = :empId and e.empDepartment = :empDepartment");
  query.setParameter("empId" ,employeId);
  query.setParameter("empDepartment",empDepartment);
  </code></pre>
  
  <p>But the above query doesnt work for first time, it generating the above error but when second time i trigged the same method again every thing went smoothly, this happens each and every time, what could be the reason for it?</p>