JPA entity manager from Datasource during runtime -


i'm wondering if there possibility create entitymanager defined datasource in during runtime via jndi lookup. imagine administrator configures new datasource within (tomee, jboss, glassfish... jee6 as) , want use datasource providing jndi name of datasource in application.

string datasourcename = "java:/myds"; datasource/resource datasource = // jndi lookup via datasourcename entitymanager em = // magic, maybe entitymanagerfactory 

note nice stay in java ee 6 specification , not use vendor specific implementation.

it has been 3 years, suppose there no easy way so. i'm closing question. if finds solution in future, may post answer , re-check correct answer.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -