> -----Original Message-----
> From: Subrahmanyam A.V.B. [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 12, 2000 11:34 PM
> Subject: Re: Singleton EJB's?
>
>
> Hi
>
> > 1. Implement your singleton as a vanilla Java class with a static
> > accessor function that returns a reference to the singleton
> > instance, constructing it if necessary.
>
> Since there will one instance of this singleton per JVM, how do make
> sure multiple instances across JVMs in a container are consistent?
>
> Subrahmanyam
>
This did not seem to be a requirement of the original question, which
asked for maintenance of in-memory statistics (instead of database),
and one app server (no mention of clustering).
If you want to add the requirement of supporting an app server cluster,
and the statistics being collected are not per-server stats, then it
seems appropriate to keep the stats in an EntityBean and store them
in a DBMS for transaction protection.
Charlie
> > 2. Implement the public API to the singleton using a Stateless
> > Session bean. At the start of each method implementation, call
> > the static accessor to get a reference to the singleton, then
> > delegate the call to the appropriate method of that object.
> >
> > > -----Original Message-----
> > > From: Robert Claeson [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 11, 2000 7:26 PM
> > > Subject: Singleton EJB's?
> > >
> > >
> > > I've yet to come up with a good solution on this one myself, so I'm turning
> > > it over to you now: what would be the best approach to implement the
> > > equivialent of a singleton EJB - i.e. one that contains shared data for all
> > > sessions WITHOUT going through a database. I'm looking for something like a
> > > singleton stateful session bean. A typical example would be a community web
> > > site with two or more web servers working against an application server,
> > > where it would be beneficial to keep shared data in memory on the app
> > > server, i.e. things like the current number of users and the like.
> > >
> > > --
> > > ?
> > >
> >
> > ===========================================================================
> > 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".
>
> --
> ----------------------------------------------------------
> Letting U=Universal, and given God=U and Unreason=U,
> Unreason=God --- Q.E.D.
> Check me at http://www.Subrahmanyam.com
> ----------------------------------------------------------
>
===========================================================================
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".