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

--
David Michaels <[EMAIL PROTECTED]>
Director of Technology
ShockMarket Corporation (650) 330-4665
We're hiring key technology roles (EJB/XML/Servlets/Java experience
needed!) at our extremely early stage startup!
See http://www.shockmarket.com!
--


Marc San Soucie wrote:
>
> Javier Borrajo wrote:
>
> > If the data is read-only and does not need to be persistent,
> > you could implement a singleton repository that provides public
> > static methods to get at the shared read-only data.
> >
> > I don't see the need for transactions, persistence or security here.
> >
> > This singleton repository would be local and available to all
> > EJBs in the same container.
>
> In some EJB architectures your beans may be distributed among a number
> of distinct Java VMs, possibly on more than one physical machine. The
> singleton will have to be remotely accessible if the contents are to
> be globally shared. If it's purely read-only, you could establish one
> singleton per VM, though getting to it may be an issue.
>
> There is also the question of securing the data, if it needs securing.
>
>         Marc San Soucie
>         GemStone Systems, Inc.
>
> ===========================================================================
> 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".
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