V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
125204412
V2EX  ›  问与答

关于SSH事务问题,求帮解决............非常奇怪项目不报错,而且数据没有提交到数据库, 更奇怪的有时候会提交,一两个字段....

  •  
  •   125204412 · 2014-01-02 17:24:38 +08:00 · 3123 次点击
    这是一个创建于 4007 天前的主题,其中的信息可能已经有所发展或是发生改变。
    spring的xml代码如下:
    <?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:p="http://www.springframework.org/schema/p"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop-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
    ">
    <!-- <import resource="" /> -->
    <context:property-placeholder location="classpath:source/jdbc.properties" />
    <!-- 通过JNDI配置DataSource <bean id="datasource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName"> <value>java:comp/env/jdbc/jboa</value> </property>
    </bean> -->
    <!-- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="username" value="${jdbc.username}" /> <property name="password"
    value="${jdbc.password}"/> <property name="driverClassName" value="${jdbc.driverClassName}"/>
    <property name="url" value="${jdbc.url}"/> </bean> -->
    <!-- C3P0 -->
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
    <property name="user" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />
    <property name="driverClass" value="${jdbc.driverClassName}" />
    <property name="jdbcUrl" value="${jdbc.url}" />
    <!--连接池最大连接数 -->
    <property name="maxPoolSize" value="40"></property>
    <!--连接池最小连接数 -->
    <property name="minPoolSize" value="1"></property>
    <!--初始化参数 -->
    <property name="initialPoolSize" value="1"></property>
    <!--连接的最大空闲时间,超时的连接将被丢弃,单位:秒 -->
    <property name="maxIdleTime" value="60"></property>
    <!--没有连接可用时,等待连接的时间,单位毫秒 -->
    <property name="checkoutTimeout" value="2000"></property>
    </bean>
    <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <!-- <property name="configLocation" value="classpath:hibernate.cfg.xml">
    </property> -->
    <property name="dataSource" ref="dataSource" />
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">${hibernate.dialect}</prop>
    <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
    <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
    </props>
    </property>
    <!-- hbm文件已改成通过插件加载 -->
    <property name="mappingResources">
    <list>
    <value>com/bdqn/wls/entity/xml/Book.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/OrderOperate.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/BookType.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Department.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Menu.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Mistake.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Order.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Person.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Position.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Power.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Role.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Send.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Site.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Stock.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/StockRecord.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/StoreRoom.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Supplier.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Supply.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/Transport.hbm.xml</value>
    <value>com/bdqn/wls/entity/xml/User.hbm.xml</value>
    </list>
    </property>
    </bean>
    <import resource="applicationContext-*" />
    <!-- 声明式事务 -->
    <!-- 事务管理器 -->
    <bean class="org.springframework.orm.hibernate3.HibernateTransactionManager"
    id="transactionManager">
    <property name="sessionFactory" ref="sessionFactory"></property>
    </bean>
    <!-- 事务管理通知 -->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
    <tx:attributes>
    <tx:method name="add*" propagation="REQUIRED" />
    <tx:method name="update*" propagation="REQUIRED" />
    <tx:method name="del*" propagation="REQUIRED" />
    <tx:method name="*" propagation="SUPPORTS" read-only="true" />
    </tx:attributes>
    </tx:advice>
    <!-- aop -->
    <aop:config>
    <aop:pointcut expression="execution(* com.bdqn.wls.service.impl.*.*(..))"
    id="bizMethod" />
    <aop:advisor advice-ref="txAdvice" pointcut-ref="bizMethod" />
    </aop:config>
    </beans>
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5341 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 109ms · UTC 09:12 · PVG 17:12 · LAX 01:12 · JFK 04:12
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.