title: LockMode in EJB3 Persistence NamedQuery
body: <p>How do we specify LockMode in EJB3 Persistence NamedQuery? I want to add Pessimistic LockMode to my existing select so that I can update if necessary but surprisingly Query object doesnot have setLockMode(xxx) method ( My understanding was if JPA,  asubset of EJB3 persistence, exposes setLockMode, EJB3 persistence should have the method available too). </p>
  
  <pre><code>Query query = em.createNamedQuery("findOptoutStudent");
  query.setParameter("optoutIndicator", optoutIndicator);
  List&lt;Student&gt; students = query.getResultList();
  return students.get(0);
  </code></pre>
  
  <p>I would assume I dont have to change the query manually to "select for update".</p>
  
  <p>Thanks
  Kevin </p>