Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-73522

Importing a Word document that contains a Table of Content produces a HibernateOptimisticLockingFailureException error message

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 7.13.0, 7.13.1, 7.13.2
    • None

      Issue Summary

      When importing a Word document to Confluence and the Word file contains headings, an image, and a Table of Content, the import appears to fail as an error message is displayed. In the background, the import seems to have succeeded as the pages were created successfully.

      Steps to Reproduce

      1. Open a Confluence page and click on ... > Import Word Document.
      2. Upload any Word document that contains Heading 1 text, an image, as well as a Table of Content.
      3. For Split by heading, choose Level 1 Headings.
      4. Click on Import.

      Expected Results

      The import should succeed with no error messages.

      Actual Results

      This error appears in the UI:

      The below exception is thrown in the atlassian-confluence.log file:

      2021-09-30 15:42:59,034 ERROR [http-nio-27130-exec-10] [org.hibernate.internal.ExceptionMapperStandardImpl] mapManagedFlushFailure HHH000346: Error during managed flush [Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.atlassian.confluence.pages.Page#1409056]]
       -- url: /c7130/pages/worddav/doimportword.action | traceId: ecdd62701881e0bf | userName: admin | referer: http://localhost:27130/c7130/pages/worddav/importword.action?pageId=360451
      2021-09-30 15:42:59,036 WARN [http-nio-27130-exec-10] [net.sf.hibernate.StaleObjectStateException] <init> An operation failed due to stale data
       -- url: /c7130/pages/worddav/doimportword.action | traceId: ecdd62701881e0bf | userName: admin | referer: http://localhost:27130/c7130/pages/worddav/importword.action?pageId=360451
      net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.atlassian.confluence.pages.Page#1409056]
      	at com.atlassian.hibernate.adapter.adapters.HibernateExceptionAdapter.adaptStaleObjectStateException(HibernateExceptionAdapter.java:580)
      	at com.atlassian.hibernate.adapter.adapters.HibernateExceptionAdapter.adaptOptimisticLockException(HibernateExceptionAdapter.java:551)
      	at com.atlassian.hibernate.adapter.adapters.HibernateExceptionAdapter.adaptImpl(HibernateExceptionAdapter.java:102)
      	at com.atlassian.hibernate.adapter.adapters.HibernateExceptionAdapter.adapt(HibernateExceptionAdapter.java:40)
      	at com.atlassian.hibernate.adapter.adapters.TransactionV2Adapter.commit(TransactionV2Adapter.java:34)
      	at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:510)
      	at com.atlassian.confluence.impl.hibernate.ConfluenceHibernateTransactionManager.doCommit(ConfluenceHibernateTransactionManager.java:69)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:746)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:714)
      ...
      2021-09-30 15:42:59,039 WARN [http-nio-27130-exec-10] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doCommit Commit failed. Rolling back. Error: Object of class [com.atlassian.confluence.pages.Page] with identifier [1409056]: optimistic locking failed; nested exception is net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.atlassian.confluence.pages.Page#1409056]
       -- url: /c7130/pages/worddav/doimportword.action | traceId: ecdd62701881e0bf | userName: admin | referer: http://localhost:27130/c7130/pages/worddav/importword.action?pageId=360451
      2021-09-30 15:42:59,039 WARN [http-nio-27130-exec-10] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
        ->[null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #358820460)
       -- url: /c7130/pages/worddav/doimportword.action | traceId: ecdd62701881e0bf | userName: admin | referer: http://localhost:27130/c7130/pages/worddav/importword.action?pageId=360451
      2021-09-30 15:42:59,040 ERROR [http-nio-27130-exec-10] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action
       -- url: /c7130/pages/worddav/doimportword.action | traceId: ecdd62701881e0bf | userName: admin | referer: http://localhost:27130/c7130/pages/worddav/importword.action?pageId=360451
      org.springframework.orm.hibernate.HibernateOptimisticLockingFailureException: Object of class [com.atlassian.confluence.pages.Page] with identifier [1409056]: optimistic locking failed; nested exception is net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.atlassian.confluence.pages.Page#1409056]
      ...
      Caused by: net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.atlassian.confluence.pages.Page#1409056]
      

      Once you navigate back to the site, you'll notice that the pages were successfully created despite the error messages.

      Workaround

      Remove the ToC from the Word document or remove the attachment before importing the file to Confluence.

        1. HTTP 500 Internal Server Error.png
          406 kB
          Athirah Zolkefli
        2. Test document with image and ToC.docx
          498 kB
          Athirah Zolkefli

              Unassigned Unassigned
              azolkefli Athirah Zolkefli (Inactive)
              Votes:
              9 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated: