An entity object accessed from more than one path in the same transaction, as shown in Figure 5-3, is called a diamond. A local diamond exists when the access paths originate from, and the entity object resides on, the same server.
Typically, EJB Server uploads data from the database at the beginning of a transaction and downloads data to the database at the end of a transaction. When more than one program accesses an Entity Bean within the same transaction, this can lead to inconsistent views of the data. For instance, if Program B updates the entity’s data and then Program C reads the data, Program C does not see the changes made by Program B. To solve this problem, when EJB Server detects a diamond, it uploads data at method invocation and downloads data when the method completes.