There are two options available for indicating that a particular EJB type should not synchronize its state to persistent storage prior to each findBy invocation: You can set an EJB environment variable within the bean's deployment descriptor, or have the bean implementation class implement a marker interface. The second technique is especially useful if you have a number of bean implementations that all extend a single root class; in this case you can have the root class implement the marker interface, causing all beans that extend this class to inherit the behavior as well.
Ensuring data integrity for queries performed during a
transaction
If you choose to disable the automatic pre-find synchronization for certain bean types, it is very important that your application use other means to ensure that queries performed during the transaction are not performed on data that may no longer be valid. You can use the flushCache method on the com.ibm.websphere.ejbcontainer.EJBContextExtension class (an extension of javax.ejb.EJBContext) to perform a manual synchronization to persistent storage at application-defined times. For more information on EJBContextExtension and its related classes SessionContextExtension, EntityContextExtension and MessageDrivenContextExtension, see the com.ibm.websphere.ejbcontainer package in the Reference > Developer > API documentation section of the information center.
Related tasks
Editing deployment descriptors