6 Replies Latest reply on Sep 17, 2001 9:33 AM by jseaman

    one stateless session bean

    jseaman

      Is there anyway to insure that a container will create
      one and only one instance of a stateless session bean no matter how much client traffic there is.

      Thanks in advance

      Jeff Seaman

        • 1. Re: one stateless session bean
          camtabor

          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.
          100
          10

          • 2. Re: one stateless session bean
            jseaman

            Thanks I thought I could do that but is this sort of thing compatible between conatiner providers.

            Thanks,

            Jeff

            • 3. Re: one stateless session bean
              camtabor

              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.

              • 4. Re: one stateless session bean
                nhebert

                Jeff,

                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...

                Cheers,

                Noel.

                • 5. Re: one stateless session bean
                  sruch

                  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!

                  regards,
                  sandro

                  • 6. Re: one stateless session bean
                    jseaman

                    Thanks Sandro,

                    Pardon my ignorance I'm new to J2ee but how would I do this through JNDI.

                    Thanks,

                    Jeff