diff --git a/Kieker.WebGUI/lib/commons-dbcp.LICENSE b/Kieker.WebGUI/lib/commons-dbcp-1.3.LICENSE similarity index 100% rename from Kieker.WebGUI/lib/commons-dbcp.LICENSE rename to Kieker.WebGUI/lib/commons-dbcp-1.3.LICENSE diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-database-config.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-database-config.xml index 8ba7b65a6a0593efcd2647c196c5595ee6c58c2d..b2e9683f64a847e53e74d6e8fca10c3fc062d926 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-database-config.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-database-config.xml @@ -7,12 +7,43 @@ http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> - <!-- The database and the transaction manager. --> - <bean id="userDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> - <property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver" /> - <property name="url" value="jdbc:derby:user;create=true" /> + <!-- The following code is necessary to create a data source pooling connections and statements. --> + <bean id="connectionFactory" class="org.apache.commons.dbcp.DriverManagerConnectionFactory"> + <constructor-arg index="0" value="jdbc:derby:user;create=true"/> + <!-- No further settings --> + <constructor-arg index="1"> + <null/> + </constructor-arg> </bean> + <bean id="connectionPool" class="org.apache.commons.pool.impl.GenericObjectPool"> + </bean> + + <bean id="statementPool" class="org.apache.commons.pool.impl.GenericKeyedObjectPoolFactory"> + <constructor-arg index="0"> + <null/> + </constructor-arg> + </bean> + + <bean id="poolableConnectionFactory" class="org.apache.commons.dbcp.PoolableConnectionFactory"> + <constructor-arg index="0" ref="connectionFactory"/> + <constructor-arg index="1" ref="connectionPool"/> + <constructor-arg index="2" ref="statementPool"/> + <!-- No validation query. --> + <constructor-arg index="3"> + <null/> + </constructor-arg> + <!-- Queries are not read only per default. --> + <constructor-arg index="4" value="false"/> + <!-- Auto comit is activated per default. --> + <constructor-arg index="5" value="true"/> + </bean> + + <bean id="userDataSource" class="org.apache.commons.dbcp.PoolingDataSource"> + <property name="pool" ref="connectionPool"/> + </bean> + + <!-- Configure a transaction manager for the data source. --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="userDataSource" /> </bean>