All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spring.musicbrainz-data.xml Maven / Gradle / Ivy

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/tx 
           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd 
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-3.0.xsd">

  <context:annotation-config />
  <context:component-scan base-package="fm.last.musicbrainz.data" />

  <bean id="musicBrainzDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" init-method="getConnection"
    destroy-method="close" lazy-init="false">
    <property name="driverClass" value="${db.musicbrainz.driver.class}" />
    <property name="jdbcUrl" value="${db.musicbrainz.url}" />
    <property name="user" value="${db.musicbrainz.user}" />
    <property name="password" value="${db.musicbrainz.password}" />
    <property name="preferredTestQuery" value="SELECT version();" />
    <property name="initialPoolSize" value="${db.musicbrainz.initial.pool.size:1}" />
    <property name="maxPoolSize" value="${db.musicbrainz.max.pool.size:1}" />
    <property name="acquireIncrement" value="${db.musicbrainz.acquire.increment:1}" />
    <property name="maxIdleTime" value="${db.musicbrainz.max.idle.time:0}" />
    <property name="idleConnectionTestPeriod" value="${db.musicbrainz.idle.connection.test.period:0}" />
  </bean>

  <bean id="musicBrainzSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    <property name="dataSource" ref="musicBrainzDataSource" />
    <property name="hibernateProperties">
      <props>
        <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
        <prop key="hibernate.hbm2ddl.auto">validate</prop>
        <prop key="hibernate.show_sql">${hibernate.show_sql:false}</prop>
        <prop key="hibernate.cache.use_second_level_cache">false</prop>
        <prop key="hibernate.cache.use_query_cache">false</prop>
      </props>
    </property>
    <property name="packagesToScan">
      <list>
        <value>fm.last.musicbrainz.data.model</value>
      </list>
    </property>
  </bean>

  <bean id="musicBrainzTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="musicBrainzSessionFactory" />
  </bean>

  <tx:annotation-driven transaction-manager="musicBrainzTransactionManager" />
</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy