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

Mail polling fails to run with org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER): Turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition

XMLWordPrintable

      Polling for mail fails due to this exception:

      2012-04-30 19:12:00,135 WARN [scheduler_Worker-7] [mail.archive.content.DefaultMailContentManager] storeIncomingMail Could not store mail message Write operations are not allowed in read-only mode (FlushMode.NEVER): Turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition.
      org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER): Turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition.
      	at org.springframework.orm.hibernate.HibernateTemplate.checkWriteOperationAllowed(HibernateTemplate.java:1000)
      	at org.springframework.orm.hibernate.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:603)
      	at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370)
      	at org.springframework.orm.hibernate.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:601)
      	at com.atlassian.hibernate.HibernateObjectDao.saveRaw(HibernateObjectDao.java:156)
      	at com.atlassian.hibernate.HibernateObjectDao.save(HibernateObjectDao.java:126)
      	at com.atlassian.confluence.core.DefaultContentEntityManager.saveContentEntity(DefaultContentEntityManager.java:44)
      	at sun.reflect.GeneratedMethodAccessor497.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129)
      	at $Proxy251.saveContentEntity(Unknown Source)
      	at sun.reflect.GeneratedMethodAccessor497.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:154)
      	at $Proxy251.saveContentEntity(Unknown Source)
      	at com.atlassian.confluence.mail.archive.content.DefaultMailContentManager.storeIncomingMail(DefaultMailContentManager.java:133)
      	at com.atlassian.confluence.mail.archive.DefaultMailAccountManager.retrieveMessages(DefaultMailAccountManager.java:172)
      	at com.atlassian.confluence.mail.archive.DefaultMailAccountManager.poll(DefaultMailAccountManager.java:117)
      	at com.atlassian.confluence.mail.archive.DefaultMailAccountManager.poll(DefaultMailAccountManager.java:81)
      	at com.atlassian.confluence.mail.archive.DefaultMailAccountManager.pollAllSpaces(DefaultMailAccountManager.java:273)
      	at com.atlassian.confluence.mail.archive.jobs.MailPollJob.doExecute(MailPollJob.java:29)
      	at com.atlassian.quartz.jobs.AbstractJob.executeInternal(AbstractJob.java:86)
      	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
      	at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$1.run(ConfluenceQuartzThreadPool.java:20)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
      

      This does not occur when trigged via the web UI. It only fails when ran from a scheduled job.

              cmiller CharlesA
              jxie Chii (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: