Sorry for the late reply. So far we worked around (or rather ignored for the time being) a part of the problem, but solved the other one.
The part we ignored so far is the programmatic configuration of EntityManagers. I understand that it is possible to achieve this by using the APIs Bill mentioned. For now we just stuck with the persistence.xml-based configuration of the EntityManager. We will, however, implement a solution for this part of the problem by implementing a custom EntityManager deployment/configuration solution. I'll happily share the solution once we've got it. The second part of the problem was solved by adding an (EJB3-) interceptor which injects an EntityManager based on the realm mentioned in my initial posting. The EntityManagers per realm to be injected, however, still have to be configured via persistence.xml - our solution implements just a dynamic choice of the persistence context to be used on a call-by-call basis until the first part of the problem is solved. To implement the dynamic EntityManager injection, a Bean has to be annotated with an interceptor. The interceptor scans the class for a field annotated with a second annotation which denotes the EntityManager field to be injected. Based on the caller principal the interceptor first identifies the realm, fetches the appropriate EntityManager from JNDI and finally injects the field. Please let me know if there is interest in the details of this solution, I can post some details here or on the Wiki. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3951878#3951878 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3951878 _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
