I see a couple of options.

1. Use an entity bean- Disadvantage: You will have to have a persistent
layer because the EJB server can passivate the bean . The advantage would be
that remote clients can access the data on the single instance.

2. Use a non EJB (I feel that using ejb's on the server side does not mean
all server side classes have to be EJbs ). The advantages are that you
wouldn't have to worry about a persistence layer . Now to actually access
the singleton class you could use a session bean whose sole purpose is to
access the singleton class. I don't know if you can directly register the
Non EJB singleton class with JNDI. I think you can and in that case you
don't need the session bean.


Sachin.

> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Richard Monson-Haefel
> Sent: Thursday, April 15, 1999 8:46 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Shared EJBs
>
>
> What about using an Entity bean but persisting to a file instead of a
> relational or object database. I think you have to go with an
> Entity bean on
> this one, making a new bean type just to support singleton seems like
> overkill.
>
> -----Original Message-----
> From: Eric Yu [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 15, 1999 9:01 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Shared EJBs
>
>
> It seems the original intent of this query (and the one in the thread on
> "Static variables in EJB") is to implement a singleton-type of
> bean.  Given
> that session beans are not sharable, EJBs in general don't support mutable
> statics, and implementing it as an entity bean seems somewhat kludgy (in
> that there may be no persistent state or primary key), should
> this singleton
> not even be an EJBean?
>
> ....
>
> ==================================================================
> =========
> 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".

Reply via email to