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? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -