Re: Static Variables in Session Beans
Johan Eltes <[email protected]>
| Newsgroups | gmane.comp.java.sun.ejb.general |
|---|---|
| Message-ID | <[email protected]> |
Is there ever a need for static fields in a SLSB as long as the app server allows you to configure the size of the bean instance pool (which implies you could set it to 1)? Instance fields of such a SLSB would serve the same purpose as using static fields, wouldn't it? There would be several advantages: - Synchronization is done by app server - No doubts regarding spec compliance - No doubts regarding class loader impact on the actual number of "cache" instances. /Johan 2004-01-02 kl. 07.06 skrev Joe Sam Shirah: > Hi Mark, > >> Anytime you have to use stateful session beans, >> you have run out of options. > > I'm not sure how your opinion relates; the topic is stateless > session > beans. > > > Joe Sam > > Joe Sam Shirah - http://www.conceptgo.com > conceptGO - Consulting/Development/Outsourcing > Java Filter Forum: http://www.ibm.com/developerworks/java/ > Just the JDBC FAQs: http://www.jguru.com/faq/JDBC > Going International? http://www.jguru.com/faq/I18N > Que Java400? http://www.jguru.com/faq/Java400 > > > ----- Original Message ----- > From: "Mark Galbreath" <[email protected]> > To: "Joe Sam Shirah" <[email protected]>; > <[email protected]> > Sent: Wednesday, December 31, 2003 7:25 PM > Subject: RE: Static Variables in Session Beans > > >> Anytime you have to use stateful session beans, you have run out of > options. >> >> Mark >> >> -----Original Message----- >> From: A mailing list for Enterprise JavaBeans development >> [mailto:[email protected]]On Behalf Of Joe Sam Shirah >> Sent: Wednesday, December 31, 2003 3:59 PM >> To: [email protected] >> Subject: Re: Static Variables in Session Beans >> >> >> In addition to shailesh sinha's comments: >> >> From the EJB 2.0 spec, section 7.8 >> >> "The term "stateless" signifies that an instance has no state for >> a >> specific client. However, the instance variables of the instance can > contain >> the state across client-invoked method calls. Examples of such states >> include an open database connection and an object reference to an EJB >> object." >> >> >> Joe Sam >> >> Joe Sam Shirah - http://www.conceptgo.com >> conceptGO - Consulting/Development/Outsourcing >> Java Filter Forum: http://www.ibm.com/developerworks/java/ >> Just the JDBC FAQs: http://www.jguru.com/faq/JDBC >> Going International? http://www.jguru.com/faq/I18N >> Que Java400? http://www.jguru.com/faq/Java400 >> >> >> ----- Original Message ----- >> From: "K. Charan Kumar" <[email protected]> >> To: <[email protected]> >> Sent: Wednesday, December 31, 2003 1:07 AM >> Subject: Re: Static Variables in Session Beans >> >> >>> Shailesh, >>> >>> If you start using static variables in Stateless session beans, >>> meaning > to >>> stateless session beans is lost... May be u can use in Stateful >>> session >>> beans...This is what I feel. >>> >>> -Cheers >>> K.Charan Kumar >>> ----- Original Message ----- >>> From: "shailesh sinha" <[email protected]> >>> To: <[email protected]> >>> Sent: Wednesday, December 31, 2003 11:32 AM >>> Subject: Re: Static Variables in Session Beans >>> >>> >>>> Yes staic variable should be used in the Stateless >>>> session beans. EJB specs has only one limitation on >>>> the static variables that is it should be read only, >>>> by using final you are making it sure, So there is no >>>> any problem in that. >>>> >>>> --- sanjeev kasarabada <[email protected]> wrote: > >>>> Can static final variables be used in Stateless >>>>> Sesion >>>>> Beans?? Is there any EJB limitation on that? Your >>>>> thoughts on this are appreciated. >>>>> Thanx, >>>>> Sanjeev >> >> > ======================================================================= > ==== >> 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".