avoid deadlock for EJB

Discussion in 'Java' started by M D, Dec 21, 2006.

  1. M D

    M D Guest

    I have one ejb with the function sayhello. This functions print out "hello
    world" in while( 1 == 1 ) loop. When the clients exits from the server by
    plugging out the nextwork from the PC, this ejb still prints out "hello
    world". Is there any event to catch when server exists by accidents so that
    I can stop printing out "hello world"?
     
    M D, Dec 21, 2006
    #1
    1. Advertising

  2. M D

    Guest

    M D wrote:
    > I have one ejb with the function sayhello. This functions print out "hello
    > world" in while( 1 == 1 ) loop. When the clients exits from the server by
    > plugging out the nextwork from the PC, this ejb still prints out "hello
    > world". Is there any event to catch when server exists by accidents so that
    > I can stop printing out "hello world"?


    Firstly, please don't multipost. You could have made the intentional
    infinate loop clear in your original post without creating a new
    thread.

    Secondly, no. If you have passed flow control from your client to your
    server, the server thread will continue to run within the EJB without
    terminating when the client disconnects. This is not unreasonable as
    EJB's are not designed to be long running in this fashion. You would
    need to solve this problem another way.
     
    , Dec 21, 2006
    #2
    1. Advertising

  3. M D

    sk Guest

    <> wrote in message
    news:...
    >
    > M D wrote:
    >> I have one ejb with the function sayhello. This functions print out
    >> "hello
    >> world" in while( 1 == 1 ) loop. When the clients exits from the server by
    >> plugging out the nextwork from the PC, this ejb still prints out "hello
    >> world". Is there any event to catch when server exists by accidents so
    >> that
    >> I can stop printing out "hello world"?

    >
    > Firstly, please don't multipost. You could have made the intentional
    > infinate loop clear in your original post without creating a new
    > thread.
    >
    > Secondly, no. If you have passed flow control from your client to your
    > server, the server thread will continue to run within the EJB without
    > terminating when the client disconnects. This is not unreasonable as
    > EJB's are not designed to be long running in this fashion. You would
    > need to solve this problem another way.
    >

    Sorry and thank you for your replay.
     
    sk, Dec 21, 2006
    #3
  4. M D

    bjeremy Guest

    M D wrote:
    > I have one ejb with the function sayhello. This functions print out "hello
    > world" in while( 1 == 1 ) loop. When the clients exits from the server by
    > plugging out the nextwork from the PC, this ejb still prints out "hello
    > world". Is there any event to catch when server exists by accidents so that
    > I can stop printing out "hello world"?


    If the client terminates the connection ,you should get an execption
    that you can catch i.e. IOException... this is a checked Exception
    (extends Exception), so are you catching and ignoring exceptions? Or
    are you not getting any exceptions from this scenario?
     
    bjeremy, Dec 22, 2006
    #4
  5. M D

    Alfred Guest

    M D wrote:
    > I have one ejb with the function sayhello. This functions print out "hello
    > world" in while( 1 == 1 ) loop. When the clients exits from the server by
    > plugging out the nextwork from the PC, this ejb still prints out "hello
    > world". Is there any event to catch when server exists by accidents so that
    > I can stop printing out "hello world"?


    Are you shure to know something about Enterprise Java Beans?
    It seems that you are the first who implement a SessionBean
    to print "hello world" to System.out.

    Alfred
     
    Alfred, Dec 22, 2006
    #5
  6. M D

    Guest

    Alfred wrote:
    > M D wrote:
    > > I have one ejb with the function sayhello. This functions print out "hello
    > > world" in while( 1 == 1 ) loop. When the clients exits from the server by
    > > plugging out the nextwork from the PC, this ejb still prints out "hello
    > > world". Is there any event to catch when server exists by accidents so that
    > > I can stop printing out "hello world"?

    >
    > Are you shure to know something about Enterprise Java Beans?
    > It seems that you are the first who implement a SessionBean
    > to print "hello world" to System.out.


    Sadder still.... 8 years ago he would have gotten $100mil in venture
    capital to develop the idea! ;o)
     
    , Dec 22, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    1
    Views:
    698
    John C. Bollinger
    Jul 15, 2003
  2. Mumbai Joe
    Replies:
    0
    Views:
    604
    Mumbai Joe
    Jul 29, 2003
  3. Dean Stevens

    How to avoid deadlock?

    Dean Stevens, Sep 1, 2003, in forum: C Programming
    Replies:
    24
    Views:
    1,347
    Markus Elfring
    Sep 18, 2003
  4. sk
    Replies:
    5
    Views:
    350
    Alfred
    Dec 22, 2006
  5. Raymond Schanks
    Replies:
    0
    Views:
    660
    Raymond Schanks
    Aug 3, 2010
Loading...

Share This Page