Role/Permissions should be ThreadLocal to the server thread assigned to
process a particular client request.  Hence the same EJBHome object will
appear to have different permissions to different users.

Gene

-----Original Message-----
From: Bryan Field-Elliot
To: [EMAIL PROTECTED]
Sent: 5/25/01 8:43 AM
Subject: Re: Are home interface references thread-safe?

Thank you, that is helpful!

A follow-on question, in slightly more nit-picky detail --

I have different kinds of users coming in via my Servlet. If I use J2EE
security (which is not decided yet), then they may have different
permissions to access different session beans (or methods within session
beans). In that scenario, can I still be using a singleton instance of
each session bean's home interface? Or do I need to pull a new reference
per-user, since each user might have different role-permissions?

I guess the question comes down to, when does the user's
role-permissions come into effect? When I do the JNDI lookup on the
interface, or when I call the first method on the interface?

Thanks again,

Bryan



Krishnan Subramanian wrote:

>bryan,
>
>yes ... highly recommended. keep all references
>cached. (eg: remote interface references of
>stateless beans & home interfaces of stateful
>beans/entity beans)
>
>it is the container/ejb vendor's responsibility
>to ensure safe access from multiple transactions/threads etc.
>
>and lastly, cache not only in your servlet but in
>your ejb's as well (say when ejbs lookup or 'use'
>other ejbs)
>
>-krish
>

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