How to create / get ConnectionProvider in Spring + Hibernate + C3P0 environment?

How to create / get ConnectionProviderin Spring (v.3.1.1) + Hibernate (v.4.1.1) + C3P0 environment?

Background:

In Spring (v.3.1.1) + Hibernate (v.4.1.1) + C3P0 environment, I am trying to create an application with several tenants. Hibernate has good documentation on the new multi-user features, but there are still missing spaces. Following Example 16.3 in the Hibernate docs, I couldn't figure out how to provide ConnectionProviderup to MultiTenantConnectionProvider. Any hints / links / ideas would be highly appreciated. Many thanks.

+5
source share
1 answer

factory ConnectionProviderUtils.buildConnectionProvider(String);, ConnectionProvider, MultiTenantConnectionProvider?

<bean id="multiTenantConnectionProvider" class="MultiTenantConnectionProviderImpl">
  <property name="connectionProvider">
    <bean class="ConnectionProviderUtils" factory-method="buildConnectionProvider">
      <constructor-arg value="type"/> 
    </bean>
  </property>
</bean>

- . , ConnectionProviderUtils, .

0

All Articles