| Take a look at the doc here: http://docs.jboss.org/hibernate/orm/5.1/userguide/html_single/Hibernate_User_Guide.html#_strategies_for_code_multitenantconnectionprovider_code_implementors The doc mentions a ConnectionProviderUtil which simplifies the creation of a datasource for you when implementing this feature. A common use case is that I'm using a single pool, but pointing to different schemas/databases. In that setup, it would be great to get access to the underlying pool and just use
to switch which database is used. The problem is that this class doesn't actually exist. There is no way to refer to the underlying datasource to get a connection. On an app server, I can lookup the datasource and get the JNDI entry. When running in SE via a microservice, I'd need to actually create a datasource. I'd prefer to leverage the JPA feature of specifying JDBC params in the persistence.xml, but I can't use it when doing this. So this ticket would be
- Update the docs to clarify how to implement this without using made up class names.
- Create a lookup mechanism to get the datasource.
|