Re: Stateless sessionbean
"Karr, David" <[email protected]> Wed, 31 Aug 2005 14:18:30 -0700
| Newsgroups | gmane.comp.java.sun.ejb.general |
|---|---|
| Message-ID | <[email protected]> |
Creating those objects in the ejbCreate() method is the right thing to do (and removing the null checks). > -----Original Message----- > From: A mailing list for Enterprise JavaBeans development > > Hi , > I have a stateless sessionbean. > I have a Helper class (DAOHelper)as member variable in > stateless session bean class.All the bean methods check > whether DAOHelper is null or not null.If null, it will create > a new instance of DAOHelper class. The DAOHelper has > StatusDAO and two other DAO classes as member variable. The > DAOHelper methods check whether DAO class is null or not > null.If null, it will create a new instance of DAO class. > > My question is , since, stateless session bean has no state, > can i create the DAOHelper instance in the bean's create(),so > that, only one DAOHelper instance will be used for all > calls.Moreover, this way, I don't have to check whether > DAOHelper is null or not null in all methods. > > Is there any disadvantage or thread issue in creating > DAOHelper instance in the create() for the above scenario? > Thanks in advance, > > ============================================================== > ============= > 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".