• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB-QL / findForUpdate methods

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do you need FOR UPDATE. If you update the Entity data the ejbStore method will be invoked in any case?
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For weblogic 7.0
http://edocs.bea.com/wls/docs70/ejb/EJB_reference.html#1131565
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Were your Original 1.1 beans CMP or BMP?
 
J Waldinger
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I havent worked on websphere but read this link
http://publib7b.boulder.ibm.com/wasinfo1/en/info/ae/ae/rdat_isolevtab.html
May be not of much help.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic