EJB Container calls ejbStore method when any business method execution completes or when any transaction completes irrespective of change in the bean's data. The entity bean's data may not change every time when the client calls the business method. So there will be lot of updates (calls to ejbStore ()) in database even though it is not required, resulting in poor performance. To solve this problem configure dirty flag property in vendor specific deployment descriptor file for CMP 1.1, for example is-modified-method-name in web logic server's weblogic-ejb-jar.xml file. For EJB2.0 CMP, it does not require to configure because EJB2.0 CMP Container supports this feature implicitly. For BMP, you have to write this method in bean's class and call this method wherever necessary. Thus calls to the database server is reduced unless the bean's data changes, improving performance.
Tip to improve performance of Entity Beans using dirty flag
- Parent Category: Java EE Tips