Hi, I am converting an application with EJB 1.1 to EJB 2.0. In my original EJB's, I have several findForUpdate methods defined for my CMP Entity beans. However, EJB2.0 and EJB-QL doesn't seem to support the "FOR UPDATE" clause in the ejb-ql statements. How do I is this done in EJB 2.0 ? Thanks, Jamie
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.
My 1.1 beans were CMP. And WebSphere is my application server. The application was coded to use these findForUpdate() methods throughout - although I'm not certain what the impact would be of replacing them with regular finder methods. It appears that the WebSphere implementation of this is called 'Access Intents'. There are 6 different kinds of access intent - I'm guessing that the one I want is: wsPessimisticUpdate. Jamie