Announcement Announcement Module
Collapse
No announcement yet.
Spring's Declarative Transaction - is not rolling back Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring's Declarative Transaction - is not rolling back

    Hi ,
    Iam using Spring 3.0 hibernate 3.5 versions and Mysql 5.1 innodb &Applying declarative TX on service layer.
    As per the logs it's rolling-back the tx but not reflecting in the DB(data getting saved in DB):
    ####Logs#####
    HTML Code:
    2013-02-11 18:30:48,124 [http-bio-8080-exec-3] DEBUG - StockIssueAction::saveIssueDtls ..Start
    2013-02-11 18:30:48,124 [http-bio-8080-exec-3] DEBUG -[B][B] Creating new transaction with name [com.ff.admin.stockmanagement.stockissue.service.StockIssueServiceImpl.saveIssueDtlsForBranch]: PROPAGATION_REQUIRES_NEW,ISOLATION_READ_COMMITTED,-com.capgemini.lbs.framework.exception.CGBusinessException
    2013-02-11 18:30:48,124 [http-bio-8080-exec-3] DEBUG - opened session at timestamp: 13605876481
    2013-02-11 18:30:48,124 [http-bio-8080-exec-3] DEBUG - Opened new Session [org.hibernate.impl.SessionImpl@ed6b75] for Hibernate transaction
    2013-02-11 18:30:48,124 [http-bio-8080-exec-3] DEBUG - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@ed6b75]
    2013-02-11 18:30:48,124 [http-bio-8080-exec-3] DEBUG - opening JDBC connection
    2013-02-11 18:30:48,171 [http-bio-8080-exec-3] DEBUG - Changing isolation level of JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@1d24174] to 2
    2013-02-11 18:30:48,280 [http-bio-8080-exec-3] DEBUG - begin
    2013-02-11 18:30:48,280 [http-bio-8080-exec-3] DEBUG - current autocommit status: true
    2013-02-11 18:30:48,280 [http-bio-8080-exec-3] DEBUG - disabling autocommit
    2013-02-11 18:30:48,327 [http-bio-8080-exec-3] DEBUG - after transaction begin
    2013-02-11 18:30:48,327 [http-bio-8080-exec-3] DEBUG - Exposing Hibernate transaction as JDBC transaction [com.mchange.v2.c3p0.impl.NewProxyConnection@1d24174]
    2013-02-11 18:30:48,421 [http-bio-8080-exec-3] DEBUG - Bound value [org.springframework.jdbc.datasource.ConnectionHolder@12070b8] for key [/B][com.mchange.v2.c3p0.ComboPooledDataSource 
    2013-02-11 18:30:48,421 [http-bio-8080-exec-3] DEBUG - Bound value [org.springframework.orm.hibernate3.SessionHolder@c870d2] for key [org.hibernate.impl.SessionFactoryImpl@32451c] to thread [http-bio-8080-exec-3]
    2013-02-11 18:30:48,421 [http-bio-8080-exec-3] DEBUG - Initializing transaction synchronization
    2013-02-11 18:30:48,421 [http-bio-8080-exec-3] DEBUG - Getting transaction for [com.ff.admin.stockmanagement.stockissue.service.StockIssueServiceImpl.saveIssueDtlsForBranch]
    2013-02-11 18:30:48,421 [http-bio-8080-exec-3] DEBUG - StockIssueServiceImpl::saveStockIssue::START
    
    2013-02-11 18:30:48,421 [http-bio-8080-exec-3] DEBUG - Retrieved value [org.springframework.orm.hibernate3.SessionHolder@c870d2] for key [org.hibernate.impl.SessionFactoryImpl@32451c] bound to thread [http-bio-8080-exec-3]
    2013-02-11 18:30:48,421 [http-bio-8080-exec-3] DEBUG - Retrieved value [org.springframework.orm.hibernate3.SessionHolder@c870d2] for key [org.hibernate.impl.SessionFactoryImpl@32451c] bound to thread [http-bio-8080-exec-3]
    
    2013-02-11 18:30:48,499 [http-bio-8080-exec-3] DEBUG - opened session at timestamp: 13605876484
    2013-02-11 18:30:48,499 [http-bio-8080-exec-3] DEBUG - executing identity-insert immediately
    2013-02-11 18:30:48,499 [http-bio-8080-exec-3] DEBUG - Inserting entity: com.ff.domain.stockmanagement.operations.issue.StockIssueDO (native id)
    2013-02-11 18:30:48,514 [http-bio-8080-exec-3] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    2013-02-11 18:30:48,514 [http-bio-8080-exec-3] DEBUG - opening JDBC connection
          insert     into        ff_f_stock_issue        ( .....)     values        (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)
    2013-02-11 18:30:48,639 [http-bio-8080-exec-3] DEBUG - Natively generated identity: 11
    2013-02-11 18:30:48,639 [http-bio-8080-exec-3] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    
    2013-02-11 18:30:48,639 [http-bio-8080-exec-3] DEBUG - processing cascade ACTION_SAVE_UPDATE for: 
    
    2013-02-11 18:30:48,639 [http-bio-8080-exec-3] DEBUG - executing insertions
    2013-02-11 18:30:48,639 [http-bio-8080-exec-3] DEBUG - executing identity-insert immediately
    2013-02-11 18:30:48,639 [http-bio-8080-exec-3] DEBUG - Inserting entity: com.ff.domain.stockmanagement.operations.issue.StockIssuePaymentDetailsDO (native id)
    2013-02-11 18:30:48,639 [http-bio-8080-exec-3] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    2013-02-11 18:30:48,639 [http-bio-8080-exec-3] DEBUG - 
      2013-02-11 18:30:48,639 [http-bio-8080-exec-3] DEBUG - preparing statement
    
    2013-02-11 18:30:48,718 [http-bio-8080-exec-3] DEBUG - executing identity-insert immediately
    2013-02-11 18:30:48,718 [http-bio-8080-exec-3] DEBUG - Inserting entity: com.ff.domain.stockmanagement.operations.issue.StockIssueItemDtlsDO (native id)
    2013-02-11 18:30:48,718 [http-bio-8080-exec-3] DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    2013-02-11 18:30:48,718 [http-bio-8080-exec-3] DEBUG - 
        insert     into        ff_f_stock_issue_item_dtls        (..)     values     (?, ?, ? ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - closing statement
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - done cascade ACTION_SAVE_UPDATE for collection: com.ff.domain.stockmanagement.operations.issue.StockIssueDO.issueItemDtlsDO
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - deleting orphans for collection: com.ff.domain.stockmanagement.operations.issue.StockIssueDO.issueItemDtlsDO
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - done deleting orphans for collection: com.ff.domain.stockmanagement.operations.issue.StockIssueDO.issueItemDtlsDO
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - done processing cascade ACTION_SAVE_UPDATE for: com.ff.domain.stockmanagement.operations.issue.StockIssueDO
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - closing session
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - performing cleanup
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - after transaction completion
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - after transaction completion
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - Completing transaction for [com.ff.admin.stockmanagement.stockissue.service.StockIssueServiceImpl.saveIssueDtlsForBranch] after exception: com.capgemini.lbs.framework.exception.CGBusinessException: com.capgemini.lbs.framework.exception.CGSystemException: com.capgemini.lbs.framework.exception.CGSystemException: sami
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - Applying rules to determine whether transaction should rollback on com.capgemini.lbs.framework.exception.CGBusinessException: com.capgemini.lbs.framework.exception.CGSystemException: com.capgemini.lbs.framework.exception.CGSystemException: sami
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - Winning rollback rule is: RollbackRuleAttribute with pattern [com.capgemini.lbs.framework.exception.CGBusinessException]
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - Triggering beforeCompletion synchronization
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - Initiating transaction rollback
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - Rolling back Hibernate transaction on Session [org.hibernate.impl.SessionImpl@ed6b75][B]
    2013-02-11 18:30:48,811 [http-bio-8080-exec-3] DEBUG - rollback
    2013-02-11 18:30:48,874 [http-bio-8080-exec-3] DEBUG - re-enabling autocommit
    2013-02-11 18:30:48,921 [http-bio-8080-exec-3] DEBUG - rolled back JDBC Connection
    2013-02-11 18:30:48,921 [http-bio-8080-exec-3] DEBUG - after transaction completion
    2013-02-11 18:30:48,921 [http-bio-8080-exec-3] DEBUG - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
    2013-02-11 18:30:48,921 [http-bio-8080-exec-3] DEBUG - after transaction completion
    2013-02-11 18:30:48,921 [http-bio-8080-exec-3] DEBUG - Triggering afterCompletion synchronization
    2013-02-11 18:30:48,921 [http-bio-8080-exec-3] DEBUG - Clearing transaction synchronization[/B]
    2013-02-11 18:30:48,921 [http-bio-8080-exec-3] DEBUG - Removed value [org.springframework.orm.hibernate3.SessionHolder@c870d2] for key [org.hibernate.impl.SessionFactoryImpl@32451c] from thread [http-bio-8080-exec-3]
    2013-02-11 18:30:48,999 [http-bio-8080-exec-3] DEBUG - Removed value [org.springframework.jdbc.datasource.ConnectionHolder@12070b8] for key [....]] from thread [http-bio-8080-exec-3]
    2013-02-11 18:30:48,999 [http-bio-8080-exec-3] DEBUG - Resetting isolation level of JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@1d24174] to 4
    2013-02-11 18:30:49,061 [http-bio-8080-exec-3] DEBUG - Closing Hibernate Session [org.hibernate.impl.SessionImpl@ed6b75] after transaction
    2013-02-11 18:30:49,061 [http-bio-8080-exec-3] DEBUG - Closing Hibernate Session
    2013-02-11 18:30:49,061 [http-bio-8080-exec-3] DEBUG - closing session
    2013-02-11 18:30:49,061 [http-bio-8080-exec-3] DEBUG - performing cleanup
    2013-02-11 18:30:49,061 [http-bio-8080-exec-3] DEBUG - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
    2013-02-11 18:30:49,061 [http-bio-8080-exec-3] DEBUG - after transaction completion
    2013-02-11 18:30:49,061 [http-bio-8080-exec-3] DEBUG - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
    2013-02-11 18:30:49,061 [http-bio-8080-exec-3] DEBUG - after transaction completion
Working...
X