2 Replies Latest reply on Feb 15, 2005 7:00 AM by pablojavierpy

    Global objects

    alexb_1593

      Hi all,

      Can I have an object (say a hashtable), which can be accessed by several instances of an EJB, like this:

      LocalTestHome testHome = new LocalTestHome();

      LocalTest test1 = testHome.create();
      LocalTest test2 = testHome.create();

      test1.putHash(object1,key1);
      Object obj = test2.getHash(key1);

      //I want to have obj==object1
      Is this possible?

      Thanks, Alex

        • 1. Re: Global objects
          pablogra

          I have a similar question.
          How can I have a class loaded when the server starts, and be available to all the EJBs??? I'm doing my own SQL layer so I would like to do this to manage connections and so.

          • 2. Re: Global objects
            pablojavierpy

            Use the JNDI naming context java:comp/env to access enterprise bean's environment. There you can place your shared objects.