Hi, i'm stuck with this:
Our application is going to be a plain EJB app with SAP JPA Persistence (arrgh...)
What I'm trying to do is to switch the EntityManager's underlying datasource during application runtime.
I tried to implement my own DataSource (as SLSB), which does the lookup on the 'real' DataSources.
This works so far, but now I have to inject that custom DataSource into my Persistencecontext somehow.
Hope someone of you has some ideas for me,
Joined: Oct 01, 2007
Why are you trying to do this?
Do you want to change it once on startup, or per query/transaction?
No, I do not want to partition my data, I'd like to be able to change the DataSource per query.
The use case is: User logs on to web, gets a combobox with all available Datasources displayed
and chooses one. The user must be able to switch to another datasource during his session.
Meanwhile I found something which contains a solution I will try tomorrow.
It's sort of an application managed solution, but I thought of something more elegant, like a dynamic DataSource implementation that
will be fed to an EntityManager or EntityManagerFactory...