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
Post a Comment