Hi Eric,
1) Is a business method considered transactional if it hits the database? In my case I am trying to retrieve instance data and I can see that before my method is called my ejbLoad code fires. So I'm guessing that this is true.
Most probably, you would have set the business method in the transactional state.This could be the reason, ejbLoad() gets fired before your business method.The Entity Bean instance variables are loaded from the DB in the "transactional type", you specify.
2) Within the bean, right before I call the 'transactional method', the member variables of the bean have expected values. Then right before ejbLoad is invoked, it will sometimes revert back to the previous state and work with the wrong values. I know it is probably not advisable, but is it possible to make the container call the ejbStore method ( or I can do it myself ) when I know the state of the bean is correct?
It is best to design your application considering that ejbLoad() would be called before your business method.ejbLoad() would load the data available in the DB, and you can then re-initialize it in the business method to the values you want.The Container recognizes the change in state of the instance variables and synchronizes the data by calling ejbStore().
Note that your EJB Container is designed to manage ejbLoad()/ejbStore() - The Bean Developer shouldn't be concerned about it.
Hope this helps.
Regards,
Sandeep
- Sun Certified Programmer for Java 2 Platform Scored 93 per cent
- Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
- IBM Enterprise Connectivity with J2EE Scored 72 per cent
- Enterprise Development on the Oracle Internet Platform Scored 44 out of 56
[This message has been edited by Desai Sandeep (edited May 10, 2001).]