2009-09-02 12:44:47,953 INFO [org.hibernate.cfg.SettingsFactory] - Echoing all SQL to stdout
2009-09-02 12:44:47,953 INFO [org.hibernate.cfg.SettingsFactory] - Statistics: disabled
2009-09-02 12:44:47,953 INFO [org.hibernate.cfg.SettingsFactory] - Deleted entity synthetic identifier rollback: disabled
2009-09-02 12:44:47,953 INFO [org.hibernate.cfg.SettingsFactory] - Default entity-mode: pojo
2009-09-02 12:44:47,953 INFO [org.hibernate.cfg.SettingsFactory] - Named query checking : enabled
2009-09-02 12:44:47,984 INFO [org.hibernate.impl.SessionFactoryImpl] - building session factory
2009-09-02 12:44:48,359 INFO [org.hibernate.impl.SessionFactoryObjectFactory] - Not binding factory to JNDI, no JNDI name configured
2009-09-02 12:44:48,515 INFO [org.springframework.orm.hibernate3.HibernateTransactionManager] - Using DataSource [org.apache.commons.dbcp.BasicDataSource@1d6fbb3] of Hibernate SessionFactory for HibernateTransactionManager
2009-09-02 12:44:48,703 INFO [com.stsoft.examonline.test] - Began transaction (1): transaction manager [org.springframework.orm.hibernate3.HibernateTransactionManager@15fb38]; default rollback = true
Hibernate: select SEQ_EMP.nextval from dual
2009-09-02 12:44:48,890 INFO [com.stsoft.examonline.test] - Rolled back transaction after test execution
2009-09-02 12:44:48,890 INFO [org.springframework.context.support.GenericApplicationContext] - Closing org.springframework.context.support.GenericApplicationContext@18e3e60: display name [org.springframework.context.support.GenericApplicationContext@18e3e60]; startup date [Wed Sep 02 12:44:46 CST 2009]; root of context hierarchy
2009-09-02 12:44:48,890 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12a3722: defining beans [propertyConfigurer,dataSource,sessionFactory,baseHibernateDao,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,txAdvice,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#1,employeeDao,employeeService]; root of factory hierarchy
2009-09-02 12:44:48,890 INFO [org.springframework.orm.hibernate3.LocalSessionFactoryBean] - Closing Hibernate SessionFactory
2009-09-02 12:44:48,890 INFO [org.hibernate.impl.SessionFactoryImpl] - closing
hibernate能查询,我执行过查询语句,
不能更新和插入
如上,插入时都能去查序列,却没有执行更新

解决方案 »

  1.   

    Rolled back transaction after test execution 事务回滚了
      

  2.   

    default rollback = true 这个是怎么回事,呵呵呵!你设置数据必须回滚啊!
      

  3.   

    就是这里我没弄明白,我事物配置文件这样的:<bean id="transactionManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean> <aop:config>
    <aop:advisor pointcut="execution(* com.stsoft.examonline.service..*.*(..))"
    advice-ref="txAdvice" />
    </aop:config>
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
    <tx:attributes>
    <tx:method name="save*" propagation="REQUIRED" />
    <tx:method name="insert*" propagation="REQUIRED" />
    <tx:method name="create*" propagation="REQUIRED" />
    <tx:method name="update*" propagation="REQUIRED" />
    <tx:method name="*" read-only="true" />
    </tx:attributes>
    </tx:advice>我也不知道怎么默认就回滚了
      

  4.   

    你打个断点跟一下,别光看日志,你可以在执行插入或更新的那一行设置,然后看看是不是执行了这句,
    执行完这句去库里看一下,是不是有数据~~还有就是有代码中没有用AbstractTransactionalDataSourceSpringContextTests这种东西对数据库操作进行测试?
      

  5.   

    public abstract class BaseTestCase extends
    AbstractTransactionalDataSourceSpringContextTests
    这是测试类,
    我直接跟踪到了DAO,他执行到了最后语句
    就是数据哭没反应,也没打印出插入语句
    搞半天不知道哪回事