Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Questions? methods of optimizing BMP Entity Bean?  RSS feed

 
Robert Strong
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!!
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!