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

Some users are unable to publish a page due to "ContentUpdatedEvent" Error when connected to the database via datasource configuration

      Note

      This issue is caused by a missing property in our previously provided configuration documents. We have updated our documentation to correct this oversight. Please review Configuring a datasource connection to ensure your configuration is up to date.

      If you would like additional details, please take a moment to review this comment.

      Issue Summary

      While Confluence is connected to the database via DataSource, we will see the following error in the atlassian-confluence.log despite the page publish successfully:

      2020-02-25 16:31:18,884 ERROR [http-nio-6731-exec-6] [atlassian.confluence.event.ConfluenceEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent@f2a4df3d] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService.syncContentOnUpdate(com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent), listener=com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService@6691a1d9} (timed)]
       -- referer: http://localhost:6731/c731/pages/resumedraft.action?draftId=327693&draftShareId=2667a813-0d56-46b0-a249-45a6ecd709b4& | url: /c731/rest/api/content/327693 | traceId: 32b4e11053495fb0 | userName: admin
      java.lang.RuntimeException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set. Listener: com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService event: com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent
      	at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:57)
      	at com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimedListenerInvoker.invoke(ConfluenceListenerHandlersConfiguration.java:96)
      	at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.lambda$run$0(ConfluenceEventDispatcher.java:93)
      	at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$doInRequestContext$0(VCacheRequestContextOperations.java:50)
      	at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:84)
      	at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:68)
      	at com.atlassian.confluence.vcache.VCacheRequestContextOperations.doInRequestContext(VCacheRequestContextOperations.java:49)
      	at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.run(ConfluenceEventDispatcher.java:93)
      .....
      ....
      ....
      ....
      Caused by: java.lang.IllegalStateException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set
      	at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.assertAutoCommitFalse(DefaultTransactionalExecutor.java:94)
      	at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.executeInternal(DefaultTransactionalExecutor.java:82)
      	at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.lambda$execute$0(DefaultTransactionalExecutor.java:43)
      	at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.lambda$execute$0(SpringHostConnectionAccessor.java:55)
      	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
      	at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.execute(SpringHostConnectionAccessor.java:49)
      

      Steps to Reproduce

      1. Install Confluence and connect any supported database via datasource
      2. Create a new page
      3. Publish the page
      4. Check the atlassian-confluence.log

      Expected Results

      The page publishes successfully with no errors in the log.

      Actual Results

      The page publishes successfully but with errors in the log.

      Notes

      If 2 users are editing the same page this error is thrown when the first user publishes (or saves) the page and later when the second user tried to publish or save he will get a pop-up with the error "Can't sync with the server. Refresh the page to try to re-establish the connection.". Refreshing the page allows to proceed.

      Workaround

      Configure the following attribute to your Tomcat datasource:

      defaultAutoCommit="false"
      

      Just as an example, here's a sample datasource configuration for PostgreSQL with this attribute:

      <Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource"
                            username="conf744dc"
                            password="conf744dc"
                            driverClassName="org.postgresql.Driver"
                            url="jdbc:postgresql://127.0.0.1:5432/conf744dc"
                            maxTotal="60"
                            maxIdle="20"
                            defaultAutoCommit="false"
                            validationQuery="select 1" />  
      

      Confluence needs to be restarted so the modifications in server.xml are captured.
      Also, if running on Data Center you must configure it on all nodes of the cluster.

      Check the Tomcat documentation for additional information on attributes to configure the Tomcat JDBC datasource.

            [CONFSERVER-59524] Some users are unable to publish a page due to "ContentUpdatedEvent" Error when connected to the database via datasource configuration

            Wendy H made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 709314 ]
            Wendy H made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 706498 ]
            Wendy H made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 706041 ]
            Steve M made changes -
            Remote Link Original: This issue links to "Page (Confluence)" [ 652636 ]
            Steve M made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 652636 ]
            James Ponting made changes -
            Description Original: {panel:title=Note|borderStyle=solid|borderColor=#6554c0|titleBGColor=#6554c0|bgColor=#eae6ff|titleColor=#ffffff}
            This issue is caused by a missing property in our previously provided configuration documents. We have updated our documentation to correct this oversight. Please review [Configuring a datasource connection|https://confluence.atlassian.com/doc/configuring-a-datasource-connection-937166084.html] to ensure your configuration is up to date.

            If you would like additional details, please take a moment to review this comment.
            {panel}

            h3. Issue Summary

            While Confluence is connected to the database via DataSource, we will see the following error in the {{atlassian-confluence.log}} despite the page publish successfully:
            {code:java}
            2020-02-25 16:31:18,884 ERROR [http-nio-6731-exec-6] [atlassian.confluence.event.ConfluenceEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent@f2a4df3d] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService.syncContentOnUpdate(com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent), listener=com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService@6691a1d9} (timed)]
             -- referer: http://localhost:6731/c731/pages/resumedraft.action?draftId=327693&draftShareId=2667a813-0d56-46b0-a249-45a6ecd709b4& | url: /c731/rest/api/content/327693 | traceId: 32b4e11053495fb0 | userName: admin
            java.lang.RuntimeException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set. Listener: com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService event: com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent
            at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:57)
            at com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimedListenerInvoker.invoke(ConfluenceListenerHandlersConfiguration.java:96)
            at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.lambda$run$0(ConfluenceEventDispatcher.java:93)
            at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$doInRequestContext$0(VCacheRequestContextOperations.java:50)
            at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:84)
            at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:68)
            at com.atlassian.confluence.vcache.VCacheRequestContextOperations.doInRequestContext(VCacheRequestContextOperations.java:49)
            at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.run(ConfluenceEventDispatcher.java:93)
            .....
            ....
            ....
            ....
            Caused by: java.lang.IllegalStateException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.assertAutoCommitFalse(DefaultTransactionalExecutor.java:94)
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.executeInternal(DefaultTransactionalExecutor.java:82)
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.lambda$execute$0(DefaultTransactionalExecutor.java:43)
            at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.lambda$execute$0(SpringHostConnectionAccessor.java:55)
            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
            at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.execute(SpringHostConnectionAccessor.java:49)
            {code}
            h3. Steps to Reproduce
             # Install Confluence and [connect any supported database via datasource|https://confluence.atlassian.com/doc/configuring-a-datasource-connection-937166084.html]
             # Create a new page
             # Publish the page
             # Check the {{atlassian-confluence.log}}

            h3. Expected Results

            The page publishes successfully with no errors in the log.
            h3. Actual Results

            The page publishes successfully but with errors in the log.
            h3. Notes

            If 2 users are editing the same page this error is thrown when the first user publishes (or saves) the page and later when the second user tried to publish or save he will get a pop-up with the error "Can't sync with the server. Refresh the page to try to re-establish the connection.". Refreshing the page allows to proceed.


            h3. Workaround
            Configure the following attribute to your Tomcat datasource:
            {code}
            defaultAutoCommit="false"
            {code}

            Just as an example, here's a sample datasource configuration for PostgreSQL with this attribute:
            {code:xml}
            <Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource"
                                  username="conf744dc"
                                  password="conf744dc"
                                  driverClassName="org.postgresql.Driver"
                                  url="jdbc:postgresql://127.0.0.1:5432/conf744dc"
                                  maxTotal="60"
                                  maxIdle="20"
                                  defaultAutoCommit="false"
                                  validationQuery="select 1" />
            {code}

            Confluence needs to be restarted so the modifications in {{server.xml}} are captured.
            Also, if running on Data Center you must configure it on all nodes of the cluster.

            Check the [Tomcat documentation|https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html] for additional information on attributes to configure the Tomcat JDBC datasource.
            New: {panel:title=Note|borderStyle=solid|borderColor=#6554c0|titleBGColor=#6554c0|bgColor=#eae6ff|titleColor=#ffffff}
            This issue is caused by a missing property in our previously provided configuration documents. We have updated our documentation to correct this oversight. Please review [Configuring a datasource connection|https://confluence.atlassian.com/doc/configuring-a-datasource-connection-937166084.html] to ensure your configuration is up to date.

            If you would like additional details, please take a moment to review [this comment|https://jira.atlassian.com/browse/CONFSERVER-59524?focusedCommentId=3049622&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-3049622].
            {panel}

            h3. Issue Summary

            While Confluence is connected to the database via DataSource, we will see the following error in the {{atlassian-confluence.log}} despite the page publish successfully:
            {code:java}
            2020-02-25 16:31:18,884 ERROR [http-nio-6731-exec-6] [atlassian.confluence.event.ConfluenceEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent@f2a4df3d] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService.syncContentOnUpdate(com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent), listener=com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService@6691a1d9} (timed)]
             -- referer: http://localhost:6731/c731/pages/resumedraft.action?draftId=327693&draftShareId=2667a813-0d56-46b0-a249-45a6ecd709b4& | url: /c731/rest/api/content/327693 | traceId: 32b4e11053495fb0 | userName: admin
            java.lang.RuntimeException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set. Listener: com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService event: com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent
            at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:57)
            at com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimedListenerInvoker.invoke(ConfluenceListenerHandlersConfiguration.java:96)
            at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.lambda$run$0(ConfluenceEventDispatcher.java:93)
            at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$doInRequestContext$0(VCacheRequestContextOperations.java:50)
            at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:84)
            at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:68)
            at com.atlassian.confluence.vcache.VCacheRequestContextOperations.doInRequestContext(VCacheRequestContextOperations.java:49)
            at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.run(ConfluenceEventDispatcher.java:93)
            .....
            ....
            ....
            ....
            Caused by: java.lang.IllegalStateException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.assertAutoCommitFalse(DefaultTransactionalExecutor.java:94)
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.executeInternal(DefaultTransactionalExecutor.java:82)
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.lambda$execute$0(DefaultTransactionalExecutor.java:43)
            at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.lambda$execute$0(SpringHostConnectionAccessor.java:55)
            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
            at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.execute(SpringHostConnectionAccessor.java:49)
            {code}
            h3. Steps to Reproduce
             # Install Confluence and [connect any supported database via datasource|https://confluence.atlassian.com/doc/configuring-a-datasource-connection-937166084.html]
             # Create a new page
             # Publish the page
             # Check the {{atlassian-confluence.log}}

            h3. Expected Results

            The page publishes successfully with no errors in the log.
            h3. Actual Results

            The page publishes successfully but with errors in the log.
            h3. Notes

            If 2 users are editing the same page this error is thrown when the first user publishes (or saves) the page and later when the second user tried to publish or save he will get a pop-up with the error "Can't sync with the server. Refresh the page to try to re-establish the connection.". Refreshing the page allows to proceed.


            h3. Workaround
            Configure the following attribute to your Tomcat datasource:
            {code}
            defaultAutoCommit="false"
            {code}

            Just as an example, here's a sample datasource configuration for PostgreSQL with this attribute:
            {code:xml}
            <Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource"
                                  username="conf744dc"
                                  password="conf744dc"
                                  driverClassName="org.postgresql.Driver"
                                  url="jdbc:postgresql://127.0.0.1:5432/conf744dc"
                                  maxTotal="60"
                                  maxIdle="20"
                                  defaultAutoCommit="false"
                                  validationQuery="select 1" />
            {code}

            Confluence needs to be restarted so the modifications in {{server.xml}} are captured.
            Also, if running on Data Center you must configure it on all nodes of the cluster.

            Check the [Tomcat documentation|https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html] for additional information on attributes to configure the Tomcat JDBC datasource.
            James Ponting made changes -
            Description Original: h3. Issue Summary

            While Confluence is connected to the database via DataSource, we will see the following error in the {{atlassian-confluence.log}} despite the page publish successfully:
            {code:java}
            2020-02-25 16:31:18,884 ERROR [http-nio-6731-exec-6] [atlassian.confluence.event.ConfluenceEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent@f2a4df3d] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService.syncContentOnUpdate(com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent), listener=com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService@6691a1d9} (timed)]
             -- referer: http://localhost:6731/c731/pages/resumedraft.action?draftId=327693&draftShareId=2667a813-0d56-46b0-a249-45a6ecd709b4& | url: /c731/rest/api/content/327693 | traceId: 32b4e11053495fb0 | userName: admin
            java.lang.RuntimeException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set. Listener: com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService event: com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent
            at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:57)
            at com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimedListenerInvoker.invoke(ConfluenceListenerHandlersConfiguration.java:96)
            at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.lambda$run$0(ConfluenceEventDispatcher.java:93)
            at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$doInRequestContext$0(VCacheRequestContextOperations.java:50)
            at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:84)
            at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:68)
            at com.atlassian.confluence.vcache.VCacheRequestContextOperations.doInRequestContext(VCacheRequestContextOperations.java:49)
            at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.run(ConfluenceEventDispatcher.java:93)
            .....
            ....
            ....
            ....
            Caused by: java.lang.IllegalStateException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.assertAutoCommitFalse(DefaultTransactionalExecutor.java:94)
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.executeInternal(DefaultTransactionalExecutor.java:82)
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.lambda$execute$0(DefaultTransactionalExecutor.java:43)
            at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.lambda$execute$0(SpringHostConnectionAccessor.java:55)
            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
            at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.execute(SpringHostConnectionAccessor.java:49)
            {code}
            h3. Steps to Reproduce
             # Install Confluence and [connect any supported database via datasource|https://confluence.atlassian.com/doc/configuring-a-datasource-connection-937166084.html]
             # Create a new page
             # Publish the page
             # Check the {{atlassian-confluence.log}}

            h3. Expected Results

            The page publishes successfully with no errors in the log.
            h3. Actual Results

            The page publishes successfully but with errors in the log.
            h3. Notes

            If 2 users are editing the same page this error is thrown when the first user publishes (or saves) the page and later when the second user tried to publish or save he will get a pop-up with the error "Can't sync with the server. Refresh the page to try to re-establish the connection.". Refreshing the page allows to proceed.


            h3. Workaround
            Configure the following attribute to your Tomcat datasource:
            {code}
            defaultAutoCommit="false"
            {code}

            Just as an example, here's a sample datasource configuration for PostgreSQL with this attribute:
            {code:xml}
            <Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource"
                                  username="conf744dc"
                                  password="conf744dc"
                                  driverClassName="org.postgresql.Driver"
                                  url="jdbc:postgresql://127.0.0.1:5432/conf744dc"
                                  maxTotal="60"
                                  maxIdle="20"
                                  defaultAutoCommit="false"
                                  validationQuery="select 1" />
            {code}

            Confluence needs to be restarted so the modifications in {{server.xml}} are captured.
            Also, if running on Data Center you must configure it on all nodes of the cluster.

            Check the [Tomcat documentation|https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html] for additional information on attributes to configure the Tomcat JDBC datasource.
            New: {panel:title=Note|borderStyle=solid|borderColor=#6554c0|titleBGColor=#6554c0|bgColor=#eae6ff|titleColor=#ffffff}
            This issue is caused by a missing property in our previously provided configuration documents. We have updated our documentation to correct this oversight. Please review [Configuring a datasource connection|https://confluence.atlassian.com/doc/configuring-a-datasource-connection-937166084.html] to ensure your configuration is up to date.

            If you would like additional details, please take a moment to review this comment.
            {panel}

            h3. Issue Summary

            While Confluence is connected to the database via DataSource, we will see the following error in the {{atlassian-confluence.log}} despite the page publish successfully:
            {code:java}
            2020-02-25 16:31:18,884 ERROR [http-nio-6731-exec-6] [atlassian.confluence.event.ConfluenceEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent@f2a4df3d] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService.syncContentOnUpdate(com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent), listener=com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService@6691a1d9} (timed)]
             -- referer: http://localhost:6731/c731/pages/resumedraft.action?draftId=327693&draftShareId=2667a813-0d56-46b0-a249-45a6ecd709b4& | url: /c731/rest/api/content/327693 | traceId: 32b4e11053495fb0 | userName: admin
            java.lang.RuntimeException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set. Listener: com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService event: com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent
            at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:57)
            at com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimedListenerInvoker.invoke(ConfluenceListenerHandlersConfiguration.java:96)
            at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.lambda$run$0(ConfluenceEventDispatcher.java:93)
            at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$doInRequestContext$0(VCacheRequestContextOperations.java:50)
            at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:84)
            at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:68)
            at com.atlassian.confluence.vcache.VCacheRequestContextOperations.doInRequestContext(VCacheRequestContextOperations.java:49)
            at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.run(ConfluenceEventDispatcher.java:93)
            .....
            ....
            ....
            ....
            Caused by: java.lang.IllegalStateException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.assertAutoCommitFalse(DefaultTransactionalExecutor.java:94)
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.executeInternal(DefaultTransactionalExecutor.java:82)
            at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.lambda$execute$0(DefaultTransactionalExecutor.java:43)
            at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.lambda$execute$0(SpringHostConnectionAccessor.java:55)
            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
            at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.execute(SpringHostConnectionAccessor.java:49)
            {code}
            h3. Steps to Reproduce
             # Install Confluence and [connect any supported database via datasource|https://confluence.atlassian.com/doc/configuring-a-datasource-connection-937166084.html]
             # Create a new page
             # Publish the page
             # Check the {{atlassian-confluence.log}}

            h3. Expected Results

            The page publishes successfully with no errors in the log.
            h3. Actual Results

            The page publishes successfully but with errors in the log.
            h3. Notes

            If 2 users are editing the same page this error is thrown when the first user publishes (or saves) the page and later when the second user tried to publish or save he will get a pop-up with the error "Can't sync with the server. Refresh the page to try to re-establish the connection.". Refreshing the page allows to proceed.


            h3. Workaround
            Configure the following attribute to your Tomcat datasource:
            {code}
            defaultAutoCommit="false"
            {code}

            Just as an example, here's a sample datasource configuration for PostgreSQL with this attribute:
            {code:xml}
            <Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource"
                                  username="conf744dc"
                                  password="conf744dc"
                                  driverClassName="org.postgresql.Driver"
                                  url="jdbc:postgresql://127.0.0.1:5432/conf744dc"
                                  maxTotal="60"
                                  maxIdle="20"
                                  defaultAutoCommit="false"
                                  validationQuery="select 1" />
            {code}

            Confluence needs to be restarted so the modifications in {{server.xml}} are captured.
            Also, if running on Data Center you must configure it on all nodes of the cluster.

            Check the [Tomcat documentation|https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html] for additional information on attributes to configure the Tomcat JDBC datasource.
            James Ponting made changes -
            QA Demo Status Original: Not Done [ 14330 ] New: Not Needed [ 14332 ]
            QA Kickoff Status Original: Not Done [ 14234 ] New: Not Needed [ 14236 ]
            Resolution New: Answered [ 9 ]
            Status Original: In Progress [ 3 ] New: Closed [ 6 ]
            Rachel Robins made changes -
            Remote Link Original: This issue links to "Page (Atlassian Documentation)" [ 641697 ]
            Rachel Robins made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 641762 ]

              jponting James Ponting
              jwaihou Jonathan Soo
              Affected customers:
              45 This affects my team
              Watchers:
              67 Start watching this issue

                Created:
                Updated:
                Resolved: