Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB  RSS feed

 
anvi kon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a code like this below. I want to kill out the process when proctime is greater than Max_time.


Can anyone help me please?

Thanks
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36417
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On some application servers the lookup will timeout based on a network setting. If yours hangs forever, the only thing I can think of is to do the lookup in another thread so you can kill it. But EJB isn't intended to use threads so that's not a good solution.
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you please choose more informative subjects better than "EJB" in a forum named "EJB"?
 
anvi kon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can you please give me some example in ejb using a thread to kill the process?


I never tried a thread in ejb .


thanks


 
Jayr Motta
Ranch Hand
Posts: 110
Google App Engine Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Section 21.2.2 of the EJB 3.1 specification:

The enterprise bean must not attempt to manage threads. The enterprise bean must not attempt
to start, stop, suspend, or resume a thread, or to change a thread’s priority or name. The enter-
prise bean must not attempt to manage thread groups.

These functions are reserved for the EJB container. Allowing the enterprise bean to manage threads
would decrease the container’s ability to properly manage the runtime environment.


Hope this helps!
 
anvi kon
Ranch Hand
Posts: 133
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.

Is there any other option to kill the process as I shown in my code for lookup? It was just hanging there, not coming out of the loop.



 
Jayr Motta
Ranch Hand
Posts: 110
Google App Engine Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But it's not a good practice, to keep a thread wait just because you want something timed. You'd better use timer API to timed actions, you can start a timer and then do whatever you want to.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!