This makes perfect sense - I suspect I encountered this confusion in the first place
because I thought session beans were aka. CORBA services/RMI objects, which they
aren't.  I guess not all things are possible with EJB's alone.

Since I want this shared data to be a cache, therefore fast, therefore I want it
local- so RMI isn't really necessary. I just want a single class that's accessable
to all instances of my session bean - should I give up on this, since I'd obviously
need to do thread synchronization which is forbidden by the EJB spec?

David

Perry Hoekstra wrote:

> David Michaels wrote:
>
> > Can you guys explain to me how this singleton idea works?  Since session
> > beans are not shared between simultaneous clients, I dont see how I can
> > create just ONE of these for all clients to talk to - wouldn't multiple
> > copies get created? I do want one of these per VM, but I don't think
> > thats an issue since I'm using Weblogic and they pretty much keep
> > everything in one VM as I understand.
> >
> > So is the singleton a class, (with static members, presumably against
> > the EJB spec) or a bean, or what?
> >
> > I'm perplexed how this idea hasn't come up before - it seems to be an
> > obvious thing to need to do (to cache data in the business logic layer
> > so as to reduce load on the database (the central bottleneck)
> >
> > thanks!
> >
> > David
>
> If you check the archives, you will see a number of  discussions on 'singleton'.
> The Cliff Notes version of the discussion is this: it is not possible within EJB
> beans.  So how do you it?  Depending on you poison preference, either an RMI or
> CORBA object bound into your JNDI (depending on vendor) tree would suffice for a
> singleton object.  There is no law that says that you cannot mix distributed
> object environments.
>
> --
> Perry Hoekstra
>
> ---
> "I don't see much sense in that," said Rabbit.
> "No," said Pooh humbly, "there isn't. But there was going to be when I began it.
> It's just that something happened to it along the way."
>
> ===========================================================================
> 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".

--
David Michaels <[EMAIL PROTECTED]>
Director of Technology
ShockMarket Corporation (650) 330-4665

begin:vcard
n:Michaels;David
tel;cell:650-218-6778
tel;work:650-330-4665
x-mozilla-html:TRUE
url:http://www.shockmarket.com
org:ShockMarket Corporation
adr:;;540 University Ave Suite 350;Palo Alto;CA;94301;USA
version:2.1
email;internet:[EMAIL PROTECTED]
title:Director of Technology
fn:David Michaels
end:vcard

Reply via email to