In addition to the very good reasons listed below, one must also keep in mind that the spawning of threads (even in third party code) could violate the isolation and/or consistency of the transaction that invoked the request. Careful planning and a clear understanding of the purpose and potential side effects of a given class library could, of course, make it possible to use threads in such a way as to still maintain the integrity of the transaction.
Erik
--
Erik Huddleston, [EMAIL PROTECTED]
Chief Architect, eCustomers.com
> -----Original Message-----
> From: Paul Hodgetts [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 26, 1999 12:26 PM
> To: [EMAIL PROTECTED]
> Subject: Re: EJB Restrictions-- threads, io
>
<snip>
> I think there are two important reasons for thread restrictions.
>
> First, when a bean method is invoked, it carries along with it
> security and transactional contexts. If this thread then accesses
> resources, the contexts would be used to access the resource. Any
> thread that we create in the bean would not have this context
> attached to it, and if those threads went off and accessed
> resources, security or transaction problems can arise. If the
> container provided a means to create a thread that inherited the
> context from the main invocation thread, it might work, but this
> would be a vendor specific extension.
>
> The second issue with threads is that the container is responsible
> for maintaining its environment. Most (all?) containers have an
> internal thread pool that limits the amount of concurrent activity
> (and avoids thread create/destroy bugs in certain version of the
> JVMs ;-). If we create threads on our own, it could upset the
> environment that the container is trying to maintain. Again, the
> container could provide a facility for obtaining threads from its
> internal thread pool for our use, but that would be vendor specific.
> I think there is at least one vendor working on such a facility.
>
> Paul
>
> ==============================================================
> =============
> 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".
>
