Look for this in standardjboss.xml in your conf directory, under "Stateless Session Bean". You should be able to set the max and min size to 1.
Thanks I thought I could do that but is this sort of thing compatible between conatiner providers.
I believe this is container specific, I do not think the spec covers things like this. You can override standardjboss.xml with jboss.xml in your ejb.jar file, but still, it remains container specific.
Just jumping in here to add to my two pence. While
it might be possible to configure a EJB container
to have only once instance of a bean, why would you
want to do that??
Be aware that an EJB container manages bean
concurrency and will *NOT* permit more than one thread
of execution or remote interface to access a bean
implementation. Effectively, you have a bottle neck.
Just remember there is no portable way with the
current EJB spec to create a singleton.
Just some random thoughts...
besides the "random thoughts" of noel - which i fully support - there is of course a way to achieve the singleton-pattern in the ejb-container...
just use jndi... but... then every client must be aware of this "really special" situation!
Pardon my ignorance I'm new to J2ee but how would I do this through JNDI.