出错信息(1):
DEBUG http-8080-Processor24 com.rq.iqs.action.OperAction - doInsert 111
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@19f31de]
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Creating new transaction with name [com.rq.iqs.dbservice.OperManager.doInsert]
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - opened session at timestamp: 11654735921
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@832226] for Hibernate transaction
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@832226]
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - begin
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - opening JDBC connection
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - current autocommit status: true
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - disabling autocommit
DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext - after transaction begin
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.tomcat.dbcp.dbcp.PoolableConnection@1b6634c]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Bound value [org.springframework.jdbc.datasource.ConnectionHolder@137008a] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@122d9c] to thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Bound value [org.springframework.orm.hibernate3.SessionHolder@49b03] for key [org.hibernate.impl.SessionFactoryImpl@d83365] to thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Initializing transaction synchronization
DEBUG http-8080-Processor24 org.springframework.transaction.interceptor.TransactionInterceptor - Getting transaction for [com.rq.iqs.dbservice.OperManager.doInsert]
DEBUG http-8080-Processor24 com.rq.iqs.dao.OperDao - OperDao start doInsert.............
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Retrieved value [org.springframework.orm.hibernate3.SessionHolder@49b03] for key [org.hibernate.impl.SessionFactoryImpl@d83365] bound to thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Retrieved value [org.springframework.orm.hibernate3.SessionHolder@49b03] for key [org.hibernate.impl.SessionFactoryImpl@d83365] bound to thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTemplate - Found thread-bound Session for HibernateTemplate
DEBUG http-8080-Processor24 com.rq.iqs.dao.OperDao - dao 111111
DEBUG http-8080-Processor24 org.hibernate.event.def.DefaultSaveOrUpdateEventListener - saving transient instance
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 9091, using strategy: org.hibernate.id.Assigned
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractSaveEventListener - saving [com.rq.iqs.business.Oper#9091]
DEBUG http-8080-Processor24 com.rq.iqs.dao.OperDao - dao 222222
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTemplate - Not closing pre-bound Hibernate Session after HibernateTemplate
DEBUG http-8080-Processor24 org.springframework.transaction.interceptor.TransactionInterceptor - Completing transaction for [com.rq.iqs.dbservice.OperManager.doInsert]
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@832226]
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - commit
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - automatically flushing session
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - flushing session
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Flushing entities and processing referenced collections
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Processing unreferenced collections
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
DEBUG http-8080-Processor24 org.hibernate.pretty.Printer - listing entities:
...
DEBUG http-8080-Processor24 org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG http-8080-Processor24 org.hibernate.jdbc.AbstractBatcher - closing statement
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - registering flush end
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - post flush
DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext - before transaction completion
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - before transaction completion
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - re-enabling autocommit
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - committed JDBC Connection
DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext - after transaction completion
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - after transaction completion
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCommit synchronization
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
DEBUG http-8080-Processor24 com.rq.iqs.action.OperAction - doInsert 111
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@19f31de]
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Creating new transaction with name [com.rq.iqs.dbservice.OperManager.doInsert]
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - opened session at timestamp: 11654735921
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@832226] for Hibernate transaction
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@832226]
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - begin
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - opening JDBC connection
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - current autocommit status: true
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - disabling autocommit
DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext - after transaction begin
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.tomcat.dbcp.dbcp.PoolableConnection@1b6634c]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Bound value [org.springframework.jdbc.datasource.ConnectionHolder@137008a] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@122d9c] to thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Bound value [org.springframework.orm.hibernate3.SessionHolder@49b03] for key [org.hibernate.impl.SessionFactoryImpl@d83365] to thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Initializing transaction synchronization
DEBUG http-8080-Processor24 org.springframework.transaction.interceptor.TransactionInterceptor - Getting transaction for [com.rq.iqs.dbservice.OperManager.doInsert]
DEBUG http-8080-Processor24 com.rq.iqs.dao.OperDao - OperDao start doInsert.............
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Retrieved value [org.springframework.orm.hibernate3.SessionHolder@49b03] for key [org.hibernate.impl.SessionFactoryImpl@d83365] bound to thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Retrieved value [org.springframework.orm.hibernate3.SessionHolder@49b03] for key [org.hibernate.impl.SessionFactoryImpl@d83365] bound to thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTemplate - Found thread-bound Session for HibernateTemplate
DEBUG http-8080-Processor24 com.rq.iqs.dao.OperDao - dao 111111
DEBUG http-8080-Processor24 org.hibernate.event.def.DefaultSaveOrUpdateEventListener - saving transient instance
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 9091, using strategy: org.hibernate.id.Assigned
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractSaveEventListener - saving [com.rq.iqs.business.Oper#9091]
DEBUG http-8080-Processor24 com.rq.iqs.dao.OperDao - dao 222222
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTemplate - Not closing pre-bound Hibernate Session after HibernateTemplate
DEBUG http-8080-Processor24 org.springframework.transaction.interceptor.TransactionInterceptor - Completing transaction for [com.rq.iqs.dbservice.OperManager.doInsert]
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@832226]
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - commit
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - automatically flushing session
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - flushing session
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Flushing entities and processing referenced collections
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Processing unreferenced collections
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
DEBUG http-8080-Processor24 org.hibernate.pretty.Printer - listing entities:
...
DEBUG http-8080-Processor24 org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG http-8080-Processor24 org.hibernate.jdbc.AbstractBatcher - closing statement
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - registering flush end
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - post flush
DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext - before transaction completion
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - before transaction completion
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - re-enabling autocommit
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - committed JDBC Connection
DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext - after transaction completion
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - after transaction completion
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCommit synchronization
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
解决方案 »
- 基于DBUtils的思想,写了个xml通用工具
- 请问谁有小点的jdk1.5
- eclisp快捷方式
- Hibernate锁表功能
- 看到那个“N星以上才能进入...”的帖子,忽然想起了当年的migthline(交大的Hejlsberg)
- 公司要做报表,不知用什么样的报表工具做好,希望大家推荐。
- 昨天,今天tomcat无法正常启动,急,在线等待
- 环境变量配置问题
- 不用建ODBC,怎么连接dbf的数据库文件
- 史无前例的JSP页面乱码问题!!!!
- 我用myeclipse整合spring+hibernate,发布后出现错误,大家帮忙看看,谢谢
- 用MyEclipse5.0GA做Struts时遇到的问题action与jsp之间的事
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Clearing transaction synchronization
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Removed value [org.springframework.orm.hibernate3.SessionHolder@49b03] for key [org.hibernate.impl.SessionFactoryImpl@d83365] from thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Removed value [org.springframework.jdbc.datasource.ConnectionHolder@137008a] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@122d9c] from thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@832226] after transaction
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.SessionFactoryUtils - Closing Hibernate Session
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - closing session
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - performing cleanup
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext - after transaction completion
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - after transaction completion
DEBUG http-8080-Processor24 com.rq.iqs.action.OperAction - doInsert 222
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@755df3]
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Creating new transaction with name [com.rq.iqs.dbservice.OperManager.doInsert]
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - opened session at timestamp: 11654735923
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@16b0c24] for Hibernate transaction
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@16b0c24]
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - begin
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - opening JDBC connection
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - current autocommit status: true
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - disabling autocommit
DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext - after transaction begin
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.tomcat.dbcp.dbcp.PoolableConnection@1b6634c]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Bound value [org.springframework.jdbc.datasource.ConnectionHolder@ea25c1] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@122d9c] to thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Bound value [org.springframework.orm.hibernate3.SessionHolder@54a25f] for key [org.hibernate.impl.SessionFactoryImpl@d83365] to thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Initializing transaction synchronization
DEBUG http-8080-Processor24 org.springframework.transaction.interceptor.TransactionInterceptor - Getting transaction for [com.rq.iqs.dbservice.OperManager.doInsert]
DEBUG http-8080-Processor24 com.rq.iqs.dao.OperDao - OperDao start
doInsert.............
DEBUG http-8080-Processor24 com.rq.iqs.dao.OperDao - dao 111111
DEBUG http-8080-Processor24 org.hibernate.event.def.DefaultSaveOrUpdateEventListener - saving transient instance
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 9091, using strategy: org.hibernate.id.Assigned
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractSaveEventListener - saving [com.rq.iqs.business.Oper#9091]
DEBUG http-8080-Processor24 com.rq.iqs.dao.OperDao - dao 222222
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTemplate - Not closing pre-bound Hibernate Session after HibernateTemplate
DEBUG http-8080-Processor24 org.springframework.transaction.interceptor.TransactionInterceptor - Completing transaction for [com.rq.iqs.dbservice.OperManager.doInsert]
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@16b0c24]
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - commit
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - automatically flushing session
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - flushing session
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Flushing entities and processing referenced collections
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Processing unreferenced collections
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
DEBUG http-8080-Processor24 org.hibernate.pretty.Printer - listing entities:
...
DEBUG http-8080-Processor24 org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG http-8080-Processor24 org.hibernate.jdbc.AbstractBatcher - closing statement
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]违反了 PRIMARY KEY 约束 'PK__oper_7A9C383C'。不能在对象 'oper' 中插入重复键。
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Rolling back Hibernate transaction on Session [org.hibernate.impl.SessionImpl@16b0c24]
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - rollback
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - re-enabling autocommit
DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction - rolled back JDBC Connection
DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext - after transaction completion
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - after transaction completion
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Clearing transaction synchronization
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Removed value [org.springframework.orm.hibernate3.SessionHolder@54a25f] for key [org.hibernate.impl.SessionFactoryImpl@d83365] from thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.transaction.support.TransactionSynchronizationManager - Removed value [org.springframework.jdbc.datasource.ConnectionHolder@ea25c1] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@122d9c] from thread [http-8080-Processor24]
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.HibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@16b0c24] after transaction
DEBUG http-8080-Processor24 org.springframework.orm.hibernate3.SessionFactoryUtils - Closing Hibernate Session
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - closing session
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - performing cleanup
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext - after transaction completion
DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl - after transaction completion
...
从上述日志信息来看,似乎是每个doInsert都提交了事务,导致在出现异常时不能回滚之前第一次插入的记录。为什么不等到退出execute()时再统一处理事务呢?
spring框架本身不支持事务,需要其它支持。你看下代码有没有什么问题。
吓我一跳。
logger.debug( "doInsert 222" );
m_OperManager.doInsert( m_Oper );//新事务2
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]违反了 PRIMARY KEY 约束 'PK__oper_7A9C383C'。不能在对象 'oper' 中插入重复键。异常在这一段啊,在“新事务2”中出错,但是在logger之前“新事务1”已经被提交了,导致没有回滚。nearsun(蓝冰)能再帮我看看么?
要么用一个facade类,要么把Action的excute方法加入事务管理。<bean id="operAction " ...>
...
<property name="target">
<ref local="operAction Target" />
</property>
<property name="transactionAttributes">
<props>
<prop key="excute">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>