Hello, in our app we use JSF & EJB 3.0 (EclipseLink 2.0). We need to use Oracle proxy authorization for every connection in our stateless session beans. For this we need to obtain DB username to connect throught proxy. DB username is constructed from JSF authenticated username by a rule.
Here is an article on topic http://blogs.oracle.com/olaf/2010/04/using_oracle_proxy_authenticat.html
So when an authenticated user calls a JSF managed bean method which in it's turn calls some session bean method his username must be somehow passed to session bean.
Right now I have two not very good solutions: - pass username as a parameter in every session bean method (not very neat but will work); - the solution from the article above: to use session bean's class member variable to store username (not thread safe and potentially dangerous)
P.S. I've found solution which is using thread local variables: _http://www.adam-bien.com/roller/abien/entry/how_to_pass_context_with It works fine, but there is still an issue. I need to put current username in every jsf session managed bean before every call to ejb session bean because it must be in the same thread.