2 Replies Latest reply on Aug 8, 2002 10:18 PM by Adrian Hallam

    xml-rpc from stateful session bean

    jeff seaman Newbie

      Is it permissible to be a xml-rpc client in a stateful session bean. What I want to do is talk to a xml_rpc server process from a bean. I read that use of java.io was not permissible as a server but it was okay to read/write from a socket from a bean.

      Thanks

      Jeff Seaman

        • 1. Re: xml-rpc from stateful session bean
          Adrian Brock Master

          You are allowed to open a normal client socket.
          See section 24.2.1 in the EJB2.0 spec, Table 19.

          In practice most app servers won't stop you doing
          other operations because of the performance penality of
          running under a java SecurityManager.

          Regards,
          Adrian

          • 2. Re: xml-rpc from stateful session bean
            Adrian Hallam Newbie

            I am a bit confused about thread management... If I want to make a call through a Socket, in my case through a Stateless session bean, how should I declare my Socket.

            If I use a private class variable for my Socket, will it be thread safe? Or is there one instance of the Session Bean in memory and multiple threads running over it, meaning that I need to add synchronize blocks?

            Also, if I can use a private variable, I'm guessing that I can create my connection in ejbCreate...

            Thanks,
            Adrian - different Adrian to last post :)