Many EJB servers cannot support singleton objects. For example, some servers
require that there is a separate JVM for each client context, either for security
reasons,
or simply this is how their runtime is implemented. We intentially didn't want to
put anything into EJB that would require platform vendors to route calls from
multiple clients to a single instance.
Vlada
----- Original Message -----
From: Jim Rhyne <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 15, 1999 6:35 AM
Subject: Re: Static variables in EJBs?
> Another approach you should think about is using "singleton" Entity Beans
> to hold
> the equivalent of mutable static items. These things are created once and
> registered
> with JNDI (so that the using EJBs can find them) and other EJBs can share
> their values.
> It would be nice if they did nnot have to have public Homes, but EJB does
> not permit
> this configuration.
> Jim
>
> Jim Rhyne, STSM, Component Broker Tool Architect
> [EMAIL PROTECTED], 416 448 4383
> IBM Canada Ltd. 2G/846/1150/TOR
> 1150 Eglinton Ave. E., Toronto, Ont. M3C 1H7 CANADA
>
>
>
> Sachin Aggarwal <[EMAIL PROTECTED]> on 04/14/99 08:31:45 PM
>
> Please respond to A mailing list for Enterprise JavaBeans development
> <[EMAIL PROTECTED]>
>
> To: [EMAIL PROTECTED]
> cc: (bcc: Jim Rhyne/Somers/IBM)
> Subject: Re: Static variables in EJBs?
>
>
>
>
>
> Would you have multiple class loaders only when you have multiple EJB
> servers or even when running a single EJB server ?
>
> I am approaching this from a bean developers point of view. It's a handicap
> to not be able to use class methods and class variables. Is there a legit
> work-around besides modelling the bean class as a seperate singleton class
> and defining the static methods/variables as instance methods/variables on
> that class ?
>
> > -----Original Message-----
> > From: A mailing list for Enterprise JavaBeans development
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Imre Kifor
> > Sent: Wednesday, April 14, 1999 5:16 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Static variables in EJBs?
> >
> >
> > Static variables need to be read-only constants so that classes loaded by
> > different class loaders see consistent values.
> >
> > Imre Kifor
> > Valto Systems
> >
> > -----Original Message-----
> > From: Sachin Aggarwal <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> > Date: Wednesday, April 14, 1999 8:03 PM
> > Subject: Re: Static variables in EJBs?
> >
> >
> > >I see this specified in 16.4.
> > >
> > >Do you know why this restriction is imposed ?
> > >
> > >Is it because there is a generated BeanImpl class and that
> > raises the issue
> > >of duplicating all the static methods over there and gets complicated
> by
> > >the fact that in Java the instances can directly access static/class
> > >variables of their class and thus some methods would be
> > accessing the copy
> > >on the bean class and others could be accessing the static
> > methods/variables
> > >on the generated Impl class ?
> > >
> > >Is this restriction going to be removed in the next EJB spec ?
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: A mailing list for Enterprise JavaBeans development
> > >[mailto:[EMAIL PROTECTED]]On Behalf Of Tom Valesky
> > > Sent: Wednesday, April 14, 1999 4:11 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: Static variables in EJBs?
> > >
> > >
> > > Only if they're final. Otherwise, it's prohibited.
> > >
> > >
> > >=================================================================
> > ==========
> > > Tom Valesky -- [EMAIL PROTECTED]
> > > http://www.patriot.net/users/tvalesky
> > >
> > > -----Original Message-----
> > > From: Damon Williams <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> > > Date: Wednesday, April 14, 1999 3:12 PM
> > > Subject: Static variables in EJBs?
> > >
> > >
> > > Can you define static variables in an EJB?
> > >
> > >
> > >
> > >
> >
> > ==================================================================
> > =========
> > 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".
>
>
===========================================================================
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".