Hi People,
I am looking for a solution to my problem for days but I didn´t find anything that could really help me.
In my app I am using JBoss 4.2.3 GA and EJB3.
What I need:
Allow that each customer of my system (Today 5 but more than 2000 sooner) have it own database (Can be the same database but diferent schema). I mean, use the same entities and sessions.
I tryied to create the entityManager inside my stateless session, but without success. Today I was deep inside the jboss code looking for the code that instantiates the EntityManager when I put the code
Code:
@PersistenceContext(unitName = "default")
protected EntityManager entityManager;
because I realized that if I found this code, I would be able to change the unitName programatically and force JBoss to instantiate the correct EM and then I wouldn´t have to change any session or entity code.
I beg anyone to give me a north, could be links, concepts or any kind of example. I would really apreciate that.
Thanks in advance.
Anderson Geison Borges.