3 Replies Latest reply on Feb 12, 2002 6:53 PM by davidjencks

    Strategies for keeping references to beans after JBoss resta

    lkowalczyk

      I wonder how you deal with stale references to beans after JBoss is restarted. I mostly use enterprise beans from servlet environment and it's usually impossible to keep JBoss and servlet container restarts in sync. When JBoss is restarted, all attempts to call methods in remote or home interfaces fail with an exception.

      So far I came up with one solution to this problem. In my beans I implement dummy methods (eg. ping() ) and call them before the actual methods. When call to ping() fails I try to regain reference to home or remote interface from HomeHandle or Handle object. Surprisingly, this does not always work.

      Maybe someone knows a better way to make application resistant to EJB server restarts?

        • 1. Re: Strategies for keeping references to beans after JBoss r
          davidjencks

          1. Why do you need to restart jboss in the first place?

          2. Along the same lines, run jetty or tomcat integrated w/jboss.

          3. Use the 3.0 clustering, with several jboss's, and make sure at least one keeps running. (It may not be necessary to keep one running, I don't know enough about the proxy structure to judge.)

          • 2. Re: Strategies for keeping references to beans after JBoss r
            lkowalczyk

            1. It's because of mysql on windows. It eats up more and more memory when using InnoDB tables (eventually hangs up) and when restarted, JBoss cannot connect to it anymore. That's why I restart JBoss after mysql restart.

            2. My application depends on certain Resin features, and then, I will be using separate machines for running JBoss and Resin.

            3. I'll try that.

            • 3. Re: Strategies for keeping references to beans after JBoss r
              davidjencks

              1. You should be able to stop and restart your ConnectionFactoryLoader/XADataSourceLoader to throw out all the old connections and get new ones. Also setting idleTimeout to a small value and waiting that long (maybe 2x that long) should get rid of the dead connections. Both of these should avoid restarting jboss. The stop/restart functionality is often not very well tested, so if there is a problem let us know.

              (To stop/restart use the jmx console on port 8082, go to the page for the mbean, press stop, back, start).