Hi Jane,
Since you asked several questions, I have quoted each one before my answer...
When is data retrieved from DB server to EJB
container while using CMP entity bean?
That depends on what EJB container you are using. Generally, the container will load the database data immediately prior to invoking the method that was requested by the client.
When findByPrimaryKey method is called to get the Local
or Remote interface, has the instance of the CMP bean been created?
Yes. In order to execute the "findByPrimaryKey()" (or any other 'finder' method), the EJB container requires an instance of the bean.
Or the data is not retrieved until the getXXX
methods are called?
Again, depends on the EJB container, but I think that generally, the data is loaded from the database while executing the 'finder' method.
Hope this helps you.
Good Luck,
Avi.