Mel Nedelman
Secant Technologies
www.secant.com
[EMAIL PROTECTED]
216-595-3830
----- Original Message -----
From: James Cook <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 26, 1999 4:40 PM
Subject: Singletons (offshoot of EJB Restrictions-- threads, io)
> Theory
> ==========
> You can achieve "singletons" in EJB by using a BMP entity bean. Override
the
> findByPrimaryKey object to always return the same primary key value. Do
not
> provide a create method.
>
> Caveat
> ======
> 1. An EJB container is not required to create a single instance of an
entity
> bean per container. Many of the more scalable implementations will not do
> this. They rely on the underlying database to provide synchronization
> through isolation levels. Even if the container *does* synchronize access
to
> a single instance of the entity bean, multiple containers housing the same
> bean will create multiple instances. Therefore, this does not result in a
> *true* singleton object, although it may be suitable for your needs.
>
> 2. The transaction overhead usually associated with entity beans is not
> often desirable.
>
> Solution
> ========
> Don't use EJB to implement singletons. I would create a remote CORBA
object
> and bind it in the JNDI namespace. Sure, I end up implementing my own
> lifecycle management (or my CORBA container does), but we've been doing
that
> for years before anyone heard of EJB.
>
> jim
>
> ----- Original Message -----
> From: Ara Abrahamian <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, September 23, 1999 1:50 PM
> Subject: Re: EJB Restrictions-- threads, io
>
>
> > As far as I know only entity beans and JNDI contents are shared,
> > session beans don't. But entities are persistent. Suppose I want
> > to have something like a "static activeUsersList" in a bean and act
> > as a true singleton object, only one instance avialable.
> > How can I "cleanly" implement it?
> >
> > Ara Abrahamian
> > bi!
>
>
===========================================================================
> 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".