把Spring的配置文件贴出来看看

解决方案 »

  1.   

    spring配置文件
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    <!-- ========================= GENERAL DEFINITIONS ========================= -->
    <!-- Configurer that replaces ${...} placeholders with values from properties files -->
    <!-- (in this case, mail and JDBC related properties) -->
    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
    <list>
    <value>WEB-INF/datasource.properties</value>
    </list>
    </property>
    </bean>
       <!--Init datasource-->
        <!--Oracle DataSource-->
        <bean id="dataSource"
    class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName">
    <value>${jdbc.driver.class}</value>
    </property>
    <property name="url">
    <value>${jdbc.url}</value>
    </property>
    <property name="username">
    <value>${jdbc.user}</value>
    </property>
    <property name="password">
    <value>${jdbc.password}</value>
    </property>
    <property name="maxActive">
    <value>${pool.maxActive}</value>
    </property>
    <property name="maxIdle">
    <value>${pool.maxIdle}</value>
    </property>
    <property name="maxWait">
    <value>${pool.maxWait}</value>
    </property>
        </bean>

    <!-- TransactionManager -->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource">
    <ref local="dataSource"/>
    </property>
    </bean>

    <!-- statDaoProxy -->
    <bean id="statDaoProxy"
    class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    <property name="transactionManager">
    <ref bean="transactionManager"></ref>
    </property>
    <property name="target">
    <ref local="statDao"></ref>
    </property>
    <property name="transactionAttributes">
    <props>
    <prop key="insert*">PROPAGATION_REQUIRED</prop>
    <prop key="update*">PROPAGATION_REQUIRED</prop>
    <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
    </props>
    </property>
    </bean>
        <!--StatDao-->
        <bean id="statDao"
          class="com.asiainfo.wap.stat.dao.StatDaoJdbcImpl">
          <property name="dataSource">
            <ref bean="dataSource"/>
          </property>
        </bean>

    <!-- StatService -->
    <bean id="statSev" class="com.asiainfo.wap.stat.bo.StatService">
    <property name="statDao">
    <ref local="statDaoProxy"></ref>
    </property>
    </bean>

    <!-- userDaoProxy -->
    <bean id="userDaoProxy"
    class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    <property name="transactionManager">
    <ref bean="transactionManager"></ref>
    </property>
    <property name="target">
    <ref local="userDao"></ref>
    </property>
    <property name="transactionAttributes">
    <props>
    <prop key="insert*">PROPAGATION_REQUIRED</prop>
    <prop key="update*">PROPAGATION_REQUIRED</prop>
    <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
    </props>
    </property>
    </bean>
        <!--userDao-->
        <bean id="userDao"
          class="com.asiainfo.wap.user.dao.UserDaoJdbcImpl">
          <property name="dataSource">
            <ref bean="dataSource"/>
          </property>
        </bean>

    <!-- userService -->
    <bean id="userSev" class="com.asiainfo.wap.user.bo.UserService">
    <property name="userDao">
    <ref local="userDaoProxy"></ref>
    </property>
    </bean>
    </beans>
      

  2.   

    应该是网络原因引起的。你catch住后回滚下次再处理好了饿
      

  3.   

    找到原因了  <property name="removeAbandoned">
    <value>${pool.removeAbandoned}</value>
    </property>
    <property name="removeAbandonedTimeout">
    <value>${pool.removeAbandonedTimeout}</value>
    </property>
    <property name="logAbandoned">
    <value>${pool.logAbandoned}</value>
    </property>  在配置文档中增加垃圾回收的配置 ,以前没有用过spring自身TransactionProxyFactoryBean事务管理,都是自己手动关闭,所以没注意这个垃圾回收的配置,呵呵,谢谢大家