EntityBean

Hi to all, This is my first post to the forum..I'll appreciate if someone help me out on this..My question is: Can an EntityBean's Finder methods(defined with prefix ejbFind) access instance variables of the bean ??

The finder methods are on the home interface and help to find the requested beans. They do not have access to the bean at all while doing their job. Therefore, they would not have access to instance variables on the bean.

The finder methods are on the home interface and help to find the requested beans. They do not have access to the bean at all while doing their job. Therefore, they would not have access to instance variables on the bean.

Jeanne Boyarsky,

Correct me, If I'm wrong.

For BMP(Bean Managed Persistence) beans, ejbFind..() methods are implemented by Bean developer, so he can access Beans instance variable. But for CMP(Container Managed Persistence) beans, ejbFind..() methods are implemented by container.

Thanks for replies..but i'm still confused ... i can't differentiate clearly between ejbHome and ejbFind methods... According to the sun tutorials:The Home Methods A home method contains the business logic that applies to all entity beans of a particular class. In contrast, the logic in a business method applies to a single entity bean, an instance with a unique identity. During a home method invocation, the instance has neither a unique identity nor a state that represents a business object. Consequently, a home method must not access the bean's persistence state (instance variables). (For container-managed persistence, a home method also must not access relationships.)

Does that mean finder methods are only used to fetch some beans without doing any transactions on them and that home methods are meant to do some transactions on some particular beans?? Also I'm not clear on my above question yet as the tutorial doesn't say anything about it..

For BMP(Bean Managed Persistence) beans, ejbFind..() methods are implemented by Bean developer, so he can access Beans instance variable. But for CMP(Container Managed Persistence) beans, ejbFind..() methods are implemented by container.

The finders run when the bean is pooled so I guess it wont make much sense to use their instance variables when one instance is trying to represent all other instances in the pool. However with home business methods and ejbSelect methods, they can run when the bean has full beaness and is out of the pool. So I think it might make more sense there. The home business methods and ejbSelect methods can run when the bean is pooled also.

I think you "can" access the instance variables but they would not have any persistence state, which kinda defeats the whole purpose of using them.