On seemingly every click, Confluence throws a warning similar to the following:

      2014-05-05 17:40:45,417 WARN [http-bio-8055-exec-10] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context.
      

      Steps to Reproduce

      1. Install and start Confluence 5.5
      2. Click around and monitor the logs

      Workaround

      To suppress the warnings, edit <confluence-install-directory>/confluence/WEB-INF/classes/log4j.properties:

      ...
      ## caching debugging
      log4j.logger.com.atlassian.confluence.cache=ERROR, confluencelog
      log4j.additivity.com.atlassian.confluence.cache=false
      

            [CONFSERVER-33557] Transactions cache warnings thrown continuously

            Thanks for the feedback msymons!

            Petro Semeniuk (Inactive) added a comment - Thanks for the feedback msymons !

            I have tested with v5.8.6. Thousands of WARN events in the logs... that stopped dead the very day that the upgrade to v5.8.6 was performed. Looking good!

            Mark Symons added a comment - I have tested with v5.8.6. Thousands of WARN events in the logs... that stopped dead the very day that the upgrade to v5.8.6 was performed. Looking good!

            Hi francois.nonnenmacher, that's correct. Fix version is 5.8.6.

            Petro Semeniuk (Inactive) added a comment - Hi francois.nonnenmacher , that's correct. Fix version is 5.8.6.

            Except that it isn't fixed on 5.8.x. On Confluence 5.8.5 in production, running Hercules will generate pages and pages of warnings:

            WARN [hercules] [atlassian.confluence.cache.TransactionalCacheFactory] logNonTxUsageWarning Update operation performed on transactional cache [stp.task.monitor.hercules] outside of a transaction. All updates to this cache should be performed from a thread with a valid transaction context.
            

            François Nonnenmacher added a comment - Except that it isn't fixed on 5.8.x. On Confluence 5.8.5 in production, running Hercules will generate pages and pages of warnings: WARN [hercules] [atlassian.confluence.cache.TransactionalCacheFactory] logNonTxUsageWarning Update operation performed on transactional cache [stp.task.monitor.hercules] outside of a transaction. All updates to this cache should be performed from a thread with a valid transaction context.

            jens.kasperek Just to give you some background.

            Non-transactional access to transactional caches in confluence was from version 1.0. In version 5.x (I don't recall whenever that was exactly 5.2.5) we added this warning message to track these caches down and we pretty much fixed all confluence codebase in v 5.7.

            So why message still appears??? The reason are cross product plugins (example: Support Tools Plugin) and plugin based scheduled jobs which use cache API shared between JIRA/Confluence/Stash. STP plugin doesn't need transactional cache, however the way we expose cache factory -> it could get only transactional cache therefore you are getting warning in log files. In JIRA, for example there is no concept of transactional caches at all (it's Confluence only thing) so if value was put into cache during transaction and transaction failed then this entry will be poisoned in JIRA (in confluence you'll get cache changes won't be committed into main cache).

            While confluence specific caches have been fixed, we can't easy update cross product plugins/scheduled jobs (that's yet another topic).

            What has been done? We logging this message in mode that it visible only to confluence developers and on our test instance. Warning won't be visible on production and won't be cluttering logs. It's not exactly "fix", rather band aid, but it's the best I can do at the moment.

            Now as 5.8.6 (5.8.x series) are the fastest version of confluence we released in last few years. I have right to assume that this issue is watched by sysadmins who watching errors in logs at daily basis and have large number of users to care about. I really recommend to upgrade to 5.8.x. I do guarantee large of audience of happy people commenting on confluence post upgrade

            Petro Semeniuk (Inactive) added a comment - jens.kasperek Just to give you some background. Non-transactional access to transactional caches in confluence was from version 1.0. In version 5.x (I don't recall whenever that was exactly 5.2.5) we added this warning message to track these caches down and we pretty much fixed all confluence codebase in v 5.7. So why message still appears??? The reason are cross product plugins (example: Support Tools Plugin) and plugin based scheduled jobs which use cache API shared between JIRA/Confluence/Stash. STP plugin doesn't need transactional cache, however the way we expose cache factory -> it could get only transactional cache therefore you are getting warning in log files. In JIRA, for example there is no concept of transactional caches at all (it's Confluence only thing) so if value was put into cache during transaction and transaction failed then this entry will be poisoned in JIRA (in confluence you'll get cache changes won't be committed into main cache). While confluence specific caches have been fixed, we can't easy update cross product plugins/scheduled jobs (that's yet another topic). What has been done? We logging this message in mode that it visible only to confluence developers and on our test instance. Warning won't be visible on production and won't be cluttering logs. It's not exactly "fix", rather band aid, but it's the best I can do at the moment. Now as 5.8.6 (5.8.x series) are the fastest version of confluence we released in last few years. I have right to assume that this issue is watched by sysadmins who watching errors in logs at daily basis and have large number of users to care about. I really recommend to upgrade to 5.8.x. I do guarantee large of audience of happy people commenting on confluence post upgrade

            I was just informed, that this issue is resolved with Conf 5.8.6 or Conf 5.9. Can we know what resolves this and if we can implement the fix in a prior version?

            Jens Kasperek (Bosch GmbH) (Inactive) added a comment - I was just informed, that this issue is resolved with Conf 5.8.6 or Conf 5.9. Can we know what resolves this and if we can implement the fix in a prior version?

            I confirm the same bug with latest Confluence 5.8.5, it seems to appear a LOT when doing a support request:

             -- referer: https://xxx/plugins/servlet/stp/view/ | url: /plugins/servlet/stp/view/create-support-request/execute | userName: sorins
            2015-07-01 17:18:10,884 WARN [support-request] [atlassian.confluence.cache.TransactionalCacheFactory] logNonTxUsageWarning Update operation performed on transactional cache [stp.task.monitor.support-request] outside of a transaction. All updates to this cache should be performed from a thread with a valid transaction context.
             -- referer: https://xxx/plugins/servlet/stp/view/ | url: /plugins/servlet/stp/view/create-support-request/execute | userName: sorins
            

            Sorin Sbarnea (Citrix) added a comment - I confirm the same bug with latest Confluence 5.8.5, it seems to appear a LOT when doing a support request: -- referer: https: //xxx/plugins/servlet/stp/view/ | url: /plugins/servlet/stp/view/create-support-request/execute | userName: sorins 2015-07-01 17:18:10,884 WARN [support-request] [atlassian.confluence.cache.TransactionalCacheFactory] logNonTxUsageWarning Update operation performed on transactional cache [stp.task.monitor.support-request] outside of a transaction. All updates to this cache should be performed from a thread with a valid transaction context. -- referer: https: //xxx/plugins/servlet/stp/view/ | url: /plugins/servlet/stp/view/create-support-request/execute | userName: sorins

            Here are two examples:

            2015-06-23 07:27:17,541 WARN [http-bio-8080-exec-85] [confluence.util.profiling.DurationThresholdWarningTimingHelperFactory] logMessage Execution time for publishing event com.atlassian.confluence.event.events.content.page.PageMoveCompletedEvent[source=page: Collaboration Model v.16 (293886071)] took 12331 ms (warning threshold is 5000 ms)
             -- url: /confluence/pages/movepage.action | userName: nac5kor | referer: https://oururl.com/confluence/display/cmmtg/Collaboration+Model | action: movepage
            2015-06-23 07:27:20,811 WARN [http-bio-8080-exec-85] [atlassian.confluence.cache.TransactionalCacheFactoryCleanupFilter] checkBoundTransactionalCaches Found some transactional caches still bound to thread following execution of [/confluence/pages/movepage.action] - [com.atlassian.bandana.BandanaPersister]
             -- url: /confluence/pages/movepage.action | userName: nac5kor | referer: https://oururl.com/confluence/display/cmmtg/Collaboration+Model
            2015-06-23 07:27:22,974 WARN [http-bio-8080-exec-85] [atlassian.confluence.cache.TransactionalCacheFactoryCleanupFilter] checkAndForceUnbindOfTransactionalCaches Forcibly unbound thread-local transactional caches prior to request execution: [com.atlassian.bandana.BandanaPersister]
             -- url: /confluence/rest/rb-core-change/1.0/isCurrentUserConfluenceAdmin | userName: ACH6FE | referer: https://oururl.com/confluence/pages/templates2/listpagetemplates.action?key=leandobd
            2015-06-23 07:27:22,975 WARN [http-bio-8080-exec-85] [atlassian.confluence.cache.TransactionalCacheFactoryCleanupFilter] checkAndForceUnbindOfTransactionalCaches Forcibly unbound thread-local transactional cached references prior to request execution: []
             -- url: /confluence/rest/rb-core-change/1.0/isCurrentUserConfluenceAdmin | userName: ACH6FE | referer: https://oururl.com/confluence/pages/templates2/listpagetemplates.action?key=leandobd
            2015-06-23 07:27:30,015 WARN [scheduler_Worker-7] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context.
            2015-06-23 07:27:30,017 WARN [scheduler_Worker-7] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context.
            2015-06-23 07:27:30,020 WARN [scheduler_Worker-7] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context.
            2015-06-23 07:27:30,022 WARN [scheduler_Worker-7] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context.
            2015-06-23 07:27:30,024 WARN [scheduler_Worker-7] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context.
            ..
            

            and

            2015-06-24 09:49:37,596 WARN [http-bio-8080-exec-150] [persistence.dao.hibernate.HibernateDraftDao] getDraft Found 3 drafts for pageId = 0 creator = 'com.atlassian.confluence.user.ConfluenceUserImpl@334feb96[olc2rt,8a83a02c4a10e5f1014a11aa51fa7faa]' draftType = 'page'
             -- url: /confluence/pages/createpage.action | userName: olc2rt | referer: https://oururl.bosch.com/confluence/display/PHOT/Applications | action: createpage
            2015-06-24 09:51:00,025 WARN [scheduler_Worker-2] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context.
            2015-06-24 09:52:09,420 WARN [http-bio-8080-exec-87] [auth.trustedapps.filter.TrustedApplicationFilterAuthenticator] authenticate Failed to login trusted application [jira:14051493] due to bad URL signature. Received protocol version [2]. Required protocol version [2]
            
            

            You see, sometimes we might have a relation to a user action. Sometimes, these log statements just occur without any further hint.

            Jens Kasperek added a comment - Here are two examples: 2015-06-23 07:27:17,541 WARN [http-bio-8080-exec-85] [confluence.util.profiling.DurationThresholdWarningTimingHelperFactory] logMessage Execution time for publishing event com.atlassian.confluence.event.events.content.page.PageMoveCompletedEvent[source=page: Collaboration Model v.16 (293886071)] took 12331 ms (warning threshold is 5000 ms) -- url: /confluence/pages/movepage.action | userName: nac5kor | referer: https: //oururl.com/confluence/display/cmmtg/Collaboration+Model | action: movepage 2015-06-23 07:27:20,811 WARN [http-bio-8080-exec-85] [atlassian.confluence.cache.TransactionalCacheFactoryCleanupFilter] checkBoundTransactionalCaches Found some transactional caches still bound to thread following execution of [/confluence/pages/movepage.action] - [com.atlassian.bandana.BandanaPersister] -- url: /confluence/pages/movepage.action | userName: nac5kor | referer: https: //oururl.com/confluence/display/cmmtg/Collaboration+Model 2015-06-23 07:27:22,974 WARN [http-bio-8080-exec-85] [atlassian.confluence.cache.TransactionalCacheFactoryCleanupFilter] checkAndForceUnbindOfTransactionalCaches Forcibly unbound thread-local transactional caches prior to request execution: [com.atlassian.bandana.BandanaPersister] -- url: /confluence/ rest /rb-core-change/1.0/isCurrentUserConfluenceAdmin | userName: ACH6FE | referer: https: //oururl.com/confluence/pages/templates2/listpagetemplates.action?key=leandobd 2015-06-23 07:27:22,975 WARN [http-bio-8080-exec-85] [atlassian.confluence.cache.TransactionalCacheFactoryCleanupFilter] checkAndForceUnbindOfTransactionalCaches Forcibly unbound thread-local transactional cached references prior to request execution: [] -- url: /confluence/ rest /rb-core-change/1.0/isCurrentUserConfluenceAdmin | userName: ACH6FE | referer: https: //oururl.com/confluence/pages/templates2/listpagetemplates.action?key=leandobd 2015-06-23 07:27:30,015 WARN [scheduler_Worker-7] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context. 2015-06-23 07:27:30,017 WARN [scheduler_Worker-7] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context. 2015-06-23 07:27:30,020 WARN [scheduler_Worker-7] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context. 2015-06-23 07:27:30,022 WARN [scheduler_Worker-7] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context. 2015-06-23 07:27:30,024 WARN [scheduler_Worker-7] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context. .. and 2015-06-24 09:49:37,596 WARN [http-bio-8080-exec-150] [persistence.dao.hibernate.HibernateDraftDao] getDraft Found 3 drafts for pageId = 0 creator = 'com.atlassian.confluence.user.ConfluenceUserImpl@334feb96[olc2rt,8a83a02c4a10e5f1014a11aa51fa7faa]' draftType = 'page' -- url: /confluence/pages/createpage.action | userName: olc2rt | referer: https: //oururl.bosch.com/confluence/display/PHOT/Applications | action: createpage 2015-06-24 09:51:00,025 WARN [scheduler_Worker-2] [atlassian.confluence.cache.TransactionalCacheFactory] warning Transactional cache update outside transaction. All updates to this cache should be performed from a thread with a valid transaction context. 2015-06-24 09:52:09,420 WARN [http-bio-8080-exec-87] [auth.trustedapps.filter.TrustedApplicationFilterAuthenticator] authenticate Failed to login trusted application [jira:14051493] due to bad URL signature. Received protocol version [2]. Required protocol version [2] You see, sometimes we might have a relation to a user action. Sometimes, these log statements just occur without any further hint.

            msymons ok, thanks. Reopening issue.

            Petro Semeniuk (Inactive) added a comment - msymons ok, thanks. Reopening issue.

            In the understanding that the warnings are being cleaned up one by one, here are a couple from from logs for Confluence v5.7.4:

            2015-06-24 01:37:42,859 INFO [scheduler_Worker-4] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache INCREMENTAL synchronisation complete for directory [ 12877825 ] in [ 98ms ]
            2015-06-24 02:10:00,106 WARN [scheduler_Worker-2] [atlassian.confluence.cache.TransactionalCacheFactory] logNonTxUsageWarning Update operation performed on transactional cache [stp.task.monitor.hercules] outside of a transaction. All updates to this cache should be performed from a thread with a valid transaction context.
            2015-06-24 02:10:00,110 WARN [scheduler_Worker-2] [atlassian.confluence.cache.TransactionalCacheFactory] logNonTxUsageWarning Update operation performed on transactional cache [stp.task.monitor.hercules] outside of a transaction. All updates to this cache should be performed from a thread with a valid transaction context.
            2015-06-24 02:10:03,858 WARN [hercules] [atlassian.confluence.cache.TransactionalCacheFactory] logNonTxUsageWarning Update operation performed on transactional cache [stp.task.monitor.hercules] outside of a transaction. All updates to this cache should be performed from a thread with a valid transaction context.
            2015-06-24 02:37:42,756 INFO [scheduler_Worker-5] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache INCREMENTAL synchronisation for directory [ 12877825 ] starting
            2015-06-24 02:37:42,760 INFO [scheduler_Worker-5] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache Attempting INCREMENTAL synchronisation for directory [ 12877825 ]
            

            I have included an hour's worth of log entries so that you can see the transactions cache warnings in context.

            Mark Symons added a comment - In the understanding that the warnings are being cleaned up one by one, here are a couple from from logs for Confluence v5.7.4: 2015-06-24 01:37:42,859 INFO [scheduler_Worker-4] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache INCREMENTAL synchronisation complete for directory [ 12877825 ] in [ 98ms ] 2015-06-24 02:10:00,106 WARN [scheduler_Worker-2] [atlassian.confluence.cache.TransactionalCacheFactory] logNonTxUsageWarning Update operation performed on transactional cache [stp.task.monitor.hercules] outside of a transaction. All updates to this cache should be performed from a thread with a valid transaction context. 2015-06-24 02:10:00,110 WARN [scheduler_Worker-2] [atlassian.confluence.cache.TransactionalCacheFactory] logNonTxUsageWarning Update operation performed on transactional cache [stp.task.monitor.hercules] outside of a transaction. All updates to this cache should be performed from a thread with a valid transaction context. 2015-06-24 02:10:03,858 WARN [hercules] [atlassian.confluence.cache.TransactionalCacheFactory] logNonTxUsageWarning Update operation performed on transactional cache [stp.task.monitor.hercules] outside of a transaction. All updates to this cache should be performed from a thread with a valid transaction context. 2015-06-24 02:37:42,756 INFO [scheduler_Worker-5] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache INCREMENTAL synchronisation for directory [ 12877825 ] starting 2015-06-24 02:37:42,760 INFO [scheduler_Worker-5] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache Attempting INCREMENTAL synchronisation for directory [ 12877825 ] I have included an hour's worth of log entries so that you can see the transactions cache warnings in context.

              psemeniuk Petro Semeniuk (Inactive)
              btom1 Brian
              Affected customers:
              12 This affects my team
              Watchers:
              43 Start watching this issue

                Created:
                Updated:
                Resolved: