Fix #860 (external database performance) by using connection pooling … (#864)

* Fix #860 (external database performance) by using connection pooling (using commons-dbcp2)
master
Frank de Lange 6 years ago committed by Andrew DeMaria
parent ac0e29bf9c
commit 8127b4f7fa
  1. 17
      airsonic-main/pom.xml
  2. 4
      airsonic-main/src/main/resources/applicationContext-db-embed.xml
  3. 4
      airsonic-main/src/test/resources/application.properties

@ -143,6 +143,23 @@
<scope>runtime</scope>
</dependency>
<!-- connection pool manager, fixes #860 (external database performance) -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.5.0</version>
<scope>runtime</scope>
<!-- this wants to pull in commons-logging v1.2 which conflicts with other dependencies -->
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>

@ -4,11 +4,11 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
profile="embed">
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
class="org.apache.commons.dbcp2.BasicDataSource">
<property name="driverClassName" value="${DatabaseConfigEmbedDriver}" />
<property name="url" value="${DatabaseConfigEmbedUrl}" />
<property name="username" value="${DatabaseConfigEmbedUsername}" />
<property name="password" value="${DatabaseConfigEmbedPassword}" />
</bean>
</beans>
</beans>

@ -6,8 +6,8 @@ logging.level.org.airsonic=INFO
logging.level.liquibase=INFO
logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p){green} %clr(---){faint} %clr(%-40.40logger{32}){blue} %clr(:){faint} %m%n%wEx
logging.pattern.file=%d{yyyy-MM-dd HH:mm:ss.SSS} %5p --- %-40.40logger{32} : %m%n%wEx
DatabaseConfigType=embed
DatabaseConfigType=legacy
DatabaseConfigEmbedDriver=org.hsqldb.jdbcDriver
DatabaseConfigEmbedUrl=jdbc:hsqldb:mem:airsonic
DatabaseConfigEmbedUsername=sa
DatabaseConfigEmbedPassword=
DatabaseConfigEmbedPassword=

Loading…
Cancel
Save