Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

avoid deadlock for EJB

Thread view: 
M D - 21 Dec 2006 15:49 GMT
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"?
wesley.hall@gmail.com - 21 Dec 2006 15:57 GMT
> 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.
sk - 21 Dec 2006 18:43 GMT
>> I have one ejb with the function sayhello. This functions print out
>> "hello
[quoted text clipped - 13 lines]
> 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.
bjeremy - 22 Dec 2006 01:28 GMT
> 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?
Alfred - 22 Dec 2006 16:27 GMT
> 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
wesley.hall@gmail.com - 22 Dec 2006 16:33 GMT
> > 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
[quoted text clipped - 5 lines]
> 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)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.