• 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

ejbLoad and ejbStore

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help.....
Using EJB version 1.1.
- Session Bean (Stateless)
- BMP
- DAO
This are the following step that i follow:-
1. Call ejbFindByPrimaryKey(key).
2. EJB container call ejbLoad().
The problem occur after calling the ejbLoad() where the container will call the ejbStore().
as what i know is, this ejbStore() method is use for update a record in the database.
In this case i just want to get a record of a particular user detail and display it on the jsp, i'm not doing any updating at all.
The question here is, is this the actual way of retrieving a record using a EJB, where once SELECT the record from database then update the record that we just retrieve before display it in JSP.I can't figure out how to avoid calling the ejbLoad().I did refer to the Pet Store 1.1.2. It make me even more confuse.
Any Suggestion.Thank in advance.
best regard,
simon khor
[ October 23, 2002: Message edited by: simon khor ]
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depending on which app server you are using, some (certainly Websphere does) let you indicate whether bean methods are read only and the container can then make optimizations by not calling ejbStore on bean instances which have only had read-only methods called on them.
Alternatively, as you are using BMP, you implement the ejbStore method so you can employ strategies to optimize this such as the Dirty Marker pattern described in the Core J2EE patterns book.
Hope this helps
 
reply
    Bookmark Topic Watch Topic
  • New Topic