Results 1 to 2 of 2

Thread: Looking up a SLSB EJB3

  1. #1
    Join Date
    Dec 2005
    Posts
    148

    Default Looking up a SLSB EJB3

    Hi,

    I have the following code working:

    Code:
        <jee:jndi-lookup 
            id="UUIDEJB"
            jndi-name="uuid"
            resource-ref="true"
            cache="false"
            proxy-interface="utils.UUID"
        />
    ....
    
        public byte[] generateUUID()
        {
            System.out.println("Generated by.." + this.hashCode());
            return generator.generateRandomBasedUUID().asByteArray();
        }
    The result is something I get is something like this:

    Code:
    Generated by..17241974
    Generated by..17241974
    Generated by..17241974
    Generated by..17241974
    Generated by..17241974
    Is this a correct behaviour? Shouldn't different beans be called?

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Usually the SLSBs are pooled by the container. Whether your requests are served by the same instance or not is decided by the container and therefore your result is perfectly valid.

    Regards,
    Andreas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •