I know the specification tells that you are not allowed to use threads in
the EJB container.
But because JMS isn't specified yet, you can't give up threads.

For example:
If you are doing networking (e.g. http-requests) in your beans the only way to
controll time-outs, is to use threads.

Gretings
Oliver

Assaf Arkin wrote:
>
> Where does the specification imply you can use td?
>
> The ban on thread is not specific to the EJB class, it is specific to
> all the application code running inside the EJB container. That covers
> everything underneath the container (EJB, related classes, related
> libraries) and above the resource managers and connectors (JDBC, JMS,
> etc).
>
> arkin
>
> Laird Nelson wrote:
> >
> > An enterprise bean may not use thread primitives.  I take this to mean
> > it cannot do this:
> >
> >   Thread t = new Thread(someRunnable);
> >   t.start();
> >
> > ...or this:
> >
> >   synchronized (someGuard) {
> >     doCriticalWork();
> >     doMoreCriticalX-Mozilla-Status: 0009...or this:
> >
> >   Thread t = new Thread(someRunnable);
> >   t.start();
> >   t.join();
> >
> > ...but the specification seems to imply that it COULD do something like
> > this--and I hope I can:
> >
> >   ThreadDelegate td =
> >     new BasicJavaObjectThatUsesThreadsAndSynchronizationInternally();
> >   td.doWork(); // implementation works with threads
> >
> > Is this true?  If for some reason it is NOT true, doesn't this mean I
> > now have to know about implementation details of all the plain-Jane Java
> > objects my enterprise bean might use?  Wouldn't such a thing blow
> > reusability out of the water?
> >
> > If it IS true, then why can't an enterprise bean use threads directly,
> > as the invocation of td.doWork() in the example above occurs in the
> > enterprise bean's caller's thread anyhow?
> >
> > Cheers,
> > Laird
> >
> > ===========================================================================
> > 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".
>
> ===========================================================================
> 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".

===========================================================================
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