After having used for a long time EJB 2.0, I'm approaching to new JPA architecture. Of course, i'm going to approach JPA in a manner which will be
suitable for daily programmig.... in my woorking scenario, a big problem which I always had to face is that there is NO unique database server
to which connect. For simplicity's sake, let say user in the group "A" must work with DBMS Server1 and users in group "B" must work with Server2,
while my Application Server is a single instance.
In my previous approach, I created a FactoryObject which, on user's profile base, looks up the correct datasource and returns a connection to the caller (usually
caller is a Session Stateless EJB). Since all Ejb must explicytly declare all transactional resources they may use, it was a bit boring to write all entries in the deployment
descriptor, but never mind... it worked well.
Now, I can't figure out how this... connection routing can be achieved via new persistence API and injection mechanism. May you suggest any hint ?
Thank you in advance !