Announcement Announcement Module
Collapse
No announcement yet.
JtaTransactionManager weird behavior Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JtaTransactionManager weird behavior

    I'm using declarative transaction management. If I use HibernateTransactionManager, everything works just fine (data are inserted and updated). If I switch to JtaTransactionManager, the transaction is rolled back automatically. I turned on the debug and got the following information. It seems Spring tried to invoke commit but then rolled back because "Transactional code has requested rollback". There's no error/warning message at all. Can any gurus out there give me an explanation? Thank you.

    13:28:36,605 DEBUG org.springframework.transaction.interceptor.Transa ctionInterceptor:240 - Invoking commit for transaction on method 'import' in class [service.ImportService]
    13:28:36,605 DEBUG org.springframework.transaction.jta.JtaTransaction Manager:356 - Transactional code has requested rollback
    13:28:36,605 DEBUG org.springframework.transaction.jta.JtaTransaction Manager:513 - Triggering beforeCompletion synchronization
    13:28:36,605 DEBUG org.springframework.transaction.support.Transactio nSynchronizationManager:170 - Removed value [org.springframework.orm.hibernate.SessionHolder@59 c8b5] for key [net.sf.hibernate.impl.SessionFactoryImpl@996b65] from thread [ImportJob]
    13:28:36,605 DEBUG org.springframework.transaction.jta.JtaTransaction Manager:434 - Initiating transaction rollback
    13:28:36,605 DEBUG org.springframework.transaction.jta.JtaTransaction Manager:550 - Rolling back JTA transaction
    13:28:36,621 DEBUG org.springframework.transaction.jta.JtaTransaction Manager:543 - Triggering afterCompletion synchronization
    13:28:36,621 DEBUG org.springframework.transaction.support.Transactio nSynchronizationManager:239 - Clearing transaction synchronization
    13:28:36,621 INFO ImportJob:47 - import completed

  • #2
    Could you show the configuration used?

    Comment


    • #3
      timeout

      I guess it was transaction time out. After I set the transaction timeout to 300 sec (long enough to complete the transaction) it just worked. I suggest to log the transaction time out event at the debug level so at least it won't confuse us anymore. Thanks & Happy New Year.

      Comment

      Working...
      X