Bonjour,
j'ai une application Java EE qui utilise des fichiers de configuration Spring ; je voudrais utiliser le connecteur c3p0 Hibernate en lieu et place du connecteur par défaut. Pour cela, j'ai un fichier de configuration applicationContext.xml défini ainsi :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="dataSource">
			<ref bean="dataSource" />
		</property>
		<property name="hibernateProperties">
			<ref local="hibernateProperties" />
		</property>
	</bean>
 
	<bean id="hibernateProperties"
		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
		<property name="properties">
			<props>
				<prop key="hibernate.dialect">
					org.hibernate.dialect.Oracle10gDialect
				</prop>
				<prop key="hibernate.show_sql">false</prop>
				<prop key="hibernate.hbm2ddl.auto">none</prop>
				<prop key="hibernate.connection.provider_class">
				xxx</prop>
				<prop key="hibernate.c3p0.min_size">5</prop>
				<prop key="hibernate.c3p0.max_size">10</prop>
				<prop key="hibernate.c3p0.timeout">1800</prop>
				<prop key="hibernate.c3p0.max_statement">50</prop>
				<prop key="hibernate.connection.release_mode">auto</prop>
				<prop key="hibernate.transaction.factory_class">
					org.hibernate.transaction.JDBCTransactionFactory
				</prop>
			</props>
		</property>
	</bean>
J'ai un doute sur la prise en compte de cette configuration car pour la propriété provider_class, je peux mettre n'importe quoi sans que cela ne lève d'exception.
Est-ce ainsi qu'il faut procéder ? Merci de vos lumières !