Use different datasources for EJB based on userprofile.
posted 13 years ago
Hey all! I'm pretty new to J2EE, and i'm trying to rewrite an old servlet-based web-app to J2EE. Things started out going very well using CMP, but my first challenge seems to be this: The application uses two databases (production and training - same datamodel/different data). If you log in as a production-user, you use the production-database, and if you are a test-user, you use the test-database. I'm hoping someone can tell me a good way to solve this. If I want to keep using CMP, do I have to make two sets of EJB's - one set for each database? If that's the case, i'm guessing there are better ways. Any ideas??? Regards, Geir L�ken