Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > avoid deadlock for EJB

Reply
Thread Tools

avoid deadlock for EJB

 
 
M D
Guest
Posts: n/a
 
      12-21-2006
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"?


 
Reply With Quote
 
 
 
 
wesley.hall@gmail.com
Guest
Posts: n/a
 
      12-21-2006

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.

 
Reply With Quote
 
 
 
 
sk
Guest
Posts: n/a
 
      12-21-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>
> 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.


 
Reply With Quote
 
bjeremy
Guest
Posts: n/a
 
      12-22-2006

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?

 
Reply With Quote
 
Alfred
Guest
Posts: n/a
 
      12-22-2006
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
 
Reply With Quote
 
wesley.hall@gmail.com
Guest
Posts: n/a
 
      12-22-2006

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)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to generate "ejb-jar.xml" from EJB class (source)? "ejb-jar.xml" appserver independent? Raymond Schanks Java 0 08-03-2010 08:21 AM
avoid deadlock with stateful EJB sk Java 5 12-22-2006 04:35 PM
How to avoid deadlock? Dean Stevens C Programming 24 09-18-2003 04:18 PM
EJB on Weblogic7 : accessing Ejb thru *Local interface* fails due to JNDI lookup Mumbai Joe Java 0 07-29-2003 04:16 PM
Dynamically Access & Call An EJB From Another EJB? Steve Java 1 07-15-2003 06:47 PM



Advertisments