Hi,
EJBs run in a restrictive environment. SecurityManager of the operating
environment in which the EJB is executing can prevent EJB from creating
Threads (either directly or indirectly). So, if your EJBs use some class that
creates threads, then your EJB may not be portable.
Instead of searching for a loophole that might allow you do create threads
etc. etc., I suggest that you take a moment to understand why such
restrictions have been placed.
Restriction on thread creates etc, are needed by the container to manage the
lifecycle of the EJBs. Similarly, If you want to use non-final static
variables
effectively in a multi-threaded environment, you need to synchronize
accesses to such variables. This in-turn might prevent the container from
managing the lifecycle of the EJBs.
Thanx,
Harish
"Bailey, Jeff" wrote:
> I understand that an EJB cannot create a new thread or have a non-final
> static, but can an EJB use an instance of another Java class (not an EJB)
> which does?
>
> If not, what patterns do EJB developers typically use to get around the
> limitations?
>
> Jeff Bailey ([EMAIL PROTECTED])
> Sr. Software Engineer
> NetGenics, Inc.
>
> ===========================================================================
> 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".