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

org.smallmind.persistence.datanucleus.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" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

  <!-- Connection Pooling -->
  <bean id="schemaConnectionInstanceFactory" class="org.smallmind.persistence.sql.pool.DriverManagerComponentInstanceFactory">
    <constructor-arg index="0" value="${jdbc.driver.class_name.pool}"/>
    <constructor-arg index="1" value="${jdbc.url.pool}"/>
    <constructor-arg index="2" value="${jdbc.user.pool}"/>
    <constructor-arg index="3" value="${jdbc.password.pool}"/>
    <property name="validationQuery" value="${jdbc.validation_query.pool}"/>
  </bean>

  <bean id="schemaDBPool" class="org.smallmind.quorum.pool.complex.ComponentPool" init-method="startup" destroy-method="shutdown">
    <constructor-arg index="0" value="dbPool"/>
    <constructor-arg index="1" ref="schemaConnectionInstanceFactory"/>
    <property name="complexPoolConfig">
      <bean class="org.smallmind.quorum.pool.complex.ComplexPoolConfig">
        <property name="testOnAcquire" value="${jdbc.pool.test_on_acquire.pool}"/>
        <property name="initialPoolSize" value="${jdbc.pool.initial_size.poo}"/>
        <property name="minPoolSize" value="${jdbc.pool.min_size.poo}"/>
        <property name="maxPoolSize" value="${jdbc.pool.max_size.poo}"/>
        <property name="acquireWaitTimeMillis" value="750"/>
        <property name="creationTimeoutMillis" value="300"/>
        <property name="maxIdleTimeSeconds" value="300"/>
        <property name="maxLeaseTimeSeconds" value="1800"/>
      </bean>
    </property>
  </bean>

  <bean id="schemaPooledDataSource" class="org.smallmind.persistence.sql.pool.PooledDataSource">
    <constructor-arg index="0" value="schema"/>
    <constructor-arg index="1" ref="schemaDBPool"/>
  </bean>

  <!-- JDO Persistence Manager -->
  <bean id="persistenceManagerFactory" class="org.smallmind.persistence.orm.spring.jdo.EntitySeekingPersistenceManagerFactoryBean">
    <property name="dataSource" ref="schemaPooledDataSource"/>
    <property name="properties">
      <props>
        <prop key="javax.jdo.PersistenceManagerFactoryClass">org.datanucleus.jdo.JDOPersistenceManagerFactory</prop>
        <prop key="datanucleus.storeManagerType">rdbms</prop>
      </props>
    </property>
  </bean>

  <bean id="proxySession" class="org.smallmind.persistence.orm.jdo.JDOProxySession">
    <constructor-arg index="0" value="orm"/>
    <constructor-arg index="1" value="schema"/>
    <constructor-arg index="2" ref="persistenceManagerFactory"/>
    <constructor-arg index="3" value="true"/>
    <constructor-arg index="4" value="true"/>
  </bean>

  <!-- AspectJ Transaction Management -->
  <bean id="transactionManagerAspect" class="org.smallmind.persistence.orm.aop.TransactionalAspect" factory-method="aspectOf"/>

  <bean id="schemaPoolMonitor" class="org.smallmind.quorum.pool.complex.jmx.ComponentPoolMonitor">
    <constructor-arg index="0" ref="schemaDBPool"/>
  </bean>

</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy