Originally posted by Pradeep Bhat:
Why do you need FOR UPDATE. If you update the Entity data the ejbStore method will be invoked in any case?
One would want to execute a SELECT FOR UPDATE statement to implement pessimistic locking.
Unfortunately, EJB-QL does not support the SELECT FOR UPDATE construct because it is supposed to be independent of SQL. However, many Application Servers do indeed support pessimistic locking in some form or another. Check the documentation for your Application Server.