4 Replies Latest reply on Aug 19, 2003 11:55 PM by Kevin Moran

    Idle Clients and SFSB Removal

    Kevin Moran Newbie

      Hi,
      Is there any way to circumvent the container's default behavior of removing a SFSB after it's idle for a while and, say, have it remove the bean only if it is no longer referenced by the client? I've played with max-bean-age and max-bean-life, but they don't really solve my problem.
      Ideally, I'd like it to behave along the lines of what the java.rmi.server.Unreferenced interface gives an RMI application (i.e., an awareness of when clients go away). Is there any way to do this short of converting my SFSBs to Entity beans or RMI objects? I like the fact that EJBs passivate. I'm just not crazy about their being removed based on a timeout. Any input would be appreciated.

      Thanks in advance,
      -kevin

        • 1. Re: Idle Clients and SFSB Removal
          Adrian Brock Master

          What is wrong with the lifetime parameters?
          Can't you just set these to a high number?

          Regards,
          Adrian

          • 2. Re: Idle Clients and SFSB Removal
            Kevin Moran Newbie

            Hi Adrian,
            Lifetime parameters are fine. But whatever values I would choose would simply be a guess. If a user leaves my app up over lunch, over the weekend or for days on end, it would be nice if his SFSB were around when he returned. It's important that I keep the long-idle users as happy as the ones who use the app for only a few minutes. My fear is that by choosing, say, a large max-bean-life that I may negatively impact the timely reclamation of objects in JBoss.
            That was my point about RMI. What I like about it is that it does reference counting. A remote object knows when it's no longer referenced and won't be gc'ed before that time. I thought if it were somehow possible to incorporate that aspect of RMI with the part of EJBs I like most, passivation, that would be the best solution for my application.

            Thanks for your input.
            -kevin

            • 3. Re: Idle Clients and SFSB Removal
              Adrian Brock Master

              There is no direct link between the SSB instance and
              the client. It is the remote interface that is an RMI
              object.

              Why don't you just specify a reasonable passivation
              period (the bean will go onto disk) then leave it there
              for 24 hours, 2 weeks or whatever?

              Regards,
              Adrian

              • 4. Re: Idle Clients and SFSB Removal
                Kevin Moran Newbie

                > There is no direct link between the SSB instance and
                > the client.

                This is the point I was missing. If there's no link, then obviously my hopes for something akin to distributed garbage collection will never work. Thanks for the info. I guess I'll take your advice and set a reasonable timeout for the bean life.

                Best,
                -kevin