From: David W. <dav...@do...> - 2002-09-05 18:37:46
|
You can learn about options A, B and C in the ejb 2.0 servlet spec, section 10.5.9, page 186: <quote> 10.5.9 Commit options The Entity Bean protocol is designed to give the Container the flexibility to select the disposition of the instance state at transaction commit time. This flexibility allows the Container to optimally manage the association of an entity object identity with the enterprise bean instances. The Container can select from the following commit-time options: - Option A: The Container caches a ready instance between transactions. The Container ensures that the instance has exclusive access to the state of the object in the persistent storage. Therefore, the Container does not have to synchronize the instance s state from the persistent storage at the beginning of the next transaction. - Option B: The Container caches a ready instance between transactions. In contrast to Option A, in this option the Container does not ensure that the instance has exclusive access to the state of the object in the persistent storage. Therefore, the Container must synchronize the instance s state from the persistent storage at the beginning of the next transaction. - Option C: The Container does not cache a ready instance between transactions. The Container returns the instance to the pool of available instances after a transaction has completed. The following table provides a summary of the commit-time options. Note that the container synchronizes the instance s state with the persistent storage at transaction commit for all three options. The selection of the commit option is transparent to the entity bean implementation the entity bean will work correctly regardless of the commit-time option chosen by the Container. The Bean Provider writes the entity bean in the same way. The object interaction diagrams in Section 10.9 illustrate the three alternative commit options in detail. Table 6 Summary of commit-time options Write instance state to database | Instance stays ready | Instance state remains valid Option A - Yes | Yes | Yes Option B - Yes | Yes | No Option C - Yes | No | No Note: The Bean Provider relies on the ejbLoad() method to be invoked when commit options B and C are used in order to resynchronize the bean s transient state with its persistent state. It is the responsibility of the container to call the ejbLoad()method at the beginning of a new transaction when commit option B or C is used. </quote> Option D is JBoss-specific, and deals with a refresh rate parameter. You can find more information about that in the JBossCMP docs, on the website docs, in the forums, in the lists...... David -- Saroj Kumar wrote: > Hi All, > > There are 4 commit option A,B,C,D. > > What is the diff. between them and when should one use them? > > Forgive me for asking these basic questions. > > TIA, > Saroj |