Entity beans: At which point of time will ejbLoad/ejbStore be called?
ejbLoad: before a first method call inside a new transaction. ejbStore: prior to transaction’s commit – beforeCompletion() method of javax.transaction.Synchronization interface (JTA) is used. In addition, for CMP, ejbStore is called before finder methods: the updated data is flushed into the database (for performance reasons this is optional – there is a tag “switch-off-storing” in persistent.xml). The special thought here is that storing before finder methods is not specified for BMP, but if a transaction has accessed both BMP and CMP beans and after that it calls a CMP finder method, then ejbStore will be called for all BMP and CMP beans.