Hi Amar, In the lifecycle of a stateless session bean, the container decides on whether ejbCreate has to be called or not on the bean instance when client calls create(..) on the home interface. It can reuse the ejb instance between users. Having said that, if you lookup all your beans in ejbCreate, the references of those beans are there till the lifetime of the bean (or unless you explicitly remove them). So when the first user accesses the bean all the references are established and the subsequent users using that instance enjoy the already set references. HTH,
- Rajeev -----Original Message----- From: Amarnath N [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 4:03 PM To: [EMAIL PROTECTED] Subject: Fw: getting homes hi alex, but i don't use all the entity beans in one method...mostly i may lookup 3 beans in a method... i have 15 entity beans...to call a method on a session bean which lookup 3 beans .... i need to lookup all the 15 entity beans (in the case ..if i lookup all the entity beans in the create method) regards amar ----- Original Message ----- From: Alex Paransky <[EMAIL PROTECTED]> To: Amarnath N <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, January 22, 2002 1:20 AM Subject: RE: getting homes > I would lookup the homes of all the entity objects in the ejbCreate() method > of your bean, then, set them to null in the ejbRemove() method of your bean. > If your bean uses other stateless session beans, you might just create them > during the ejbCreate of your bean (remove them in ejbRemove). > > Don't try to save time by making home instances STATIC, it is a bad idea and > will get you into trouble. > > -AP_ > > -----Original Message----- > From: A mailing list for Enterprise JavaBeans development > [mailto:[EMAIL PROTECTED]]On Behalf Of Amarnath N > Sent: Monday, January 21, 2002 8:00 AM > To: [EMAIL PROTECTED] > Subject: getting homes > > > hi all, > > I am using a state less session bean, which intern calls many entity > beans to store the data. In each method, i lookup each entity bean home. is > it good way to do..or else i get all the home references... > please suggest.. > > regards > amar > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff EJB-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". > > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
