I'm programming BMP Entity Bean, using Container Managed Transaction and 'required' transaction-attribute, I found that every time I call a business method of the Entity Bean,like getMethod or setMethod, it would automatically call ejbLoad and ejbStore. I wonder what I can do to prevent it from accessing database every time a business method is called?? any help appreciated!!!
posted 14 years ago
The way to do this is to have your BMP bean wrapped in a Session bean that controls the overarching transaction boundaries. What's really happening is that (as the specs clearly indicate) ejbLoad() and ejbStore() is called once per transaction -- since you're not using a session bean, each method you invoke is a new transaction... Kyle