4 Replies Latest reply on Apr 30, 2006 1:36 AM by dsecondymail

    can I set ejb timeout?

    dsecondymail

      hello:
      my ejb client calls ejb stateless session bean. but sometimes the bean processed long time, and thus, the client was hung for long time. I want to know , can I set a timeout on ejb bean?
      And another question, if I use transaction timeout, this problem still existed, I have tried to set transaction timeout in jboss, although jboss application server found it has timed out, it still doesn't return to client, the bean is still processing(perhaps hunging), only the bean has finished and returned , then jboss found its timed out, and then return to client! but I think if transaction timeout work like this manner, its no use at all. whether I have done some wrong with transaction ?

        • 1. Re: can I set ejb timeout?
          dsecondymail

          no one can help me?
          I'm so urgent for this question, thanks a lot

          • 2. Re: can I set ejb timeout?
            mlybarger

            if you're doing a potentially long running transaction and you don't want the client to wait, i would choose a MDB instead of a stateless session bean. client posts message and is done.

            though i would think that if a transaction timed out, the container should throw a remote exception possibly even a transactiontimeout excepiton?

            • 3. Re: can I set ejb timeout?
              mlybarger

              btw, i created a simple slsb, and set the timeout to 2 seconds. the client (remote java app) did indeed just hang. a message was posted on the server that the transaction timed out.

              • 4. Re: can I set ejb timeout?
                dsecondymail

                thanks for you reply.
                I know what 's your meaning.
                so the result is ejb 's session bean doesn't support timeout ( although you can set transaction timeout , but as you just said, it has a long term bug in jboss).
                but I found it so strange, why ejb couldn't support timeout on session bean's invocation? I estimate , at the lower layer of ejb implementation, session bean's invocation is actually implemented by tcp/ip
                and this layer is in asyn mode, and ejb provide a sync mode encapsulation for this action, but why it could not support a timeout into this action?