Hi!
So, if my business logic requires a bean to sleep for a predefined
time-interval, what will be the most appropriate method to be used?
at the moment, i'm using Thread.sleep() as i could find no other way. and it
works alright. well, at least on the surface!
yogesh.

"Thompson, Chris" wrote:

> I am wondering then what this part of the EJB 2.0 spec means from 24.1.2
> Programming restrictions:
>
> "* 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."
>
> I would think that this means that a bean shouldn't manage its own thread or
> any other's.  The only place I have heard (and recently from a BEA speaker)
> that you could "legally" create and/or manage threads, sockets, i/o, etc is
> in a JCA connector.  I imagine the extreme of this would be if all active
> beans were sleeping for long periods of time, I don't know how well a
> container would handle this.  Or what would happen if it wanted to passivate
> a sleeping bean.
>
> As discussed for testing purposes it would probably be ok to sleep with the
> appropriate InterruptedException catch, but with the knowledge that it may
> or may not have some affect upon the container's thread management if any.
>
> Chris Thompson
> Bean-test Developer
> http://www.empirix.com

--
 "Bad times have a scientific value. These are the occasions a good learner
would not miss"
--Ralph Waldo Emerson


*********************************************************
Disclaimer

This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to