org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: com.atlassian.core.exception.InfrastructureException: 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.]

Atlassian JIRA | Sashidaran Jayaraman [Atlassian] | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    h5. Steps to reproduce issue # Integrate Confluence with LDAP # Ensure a local user and an LDAP user have {{Subscribed to daily updates}} # Stop Confluence server # Remove the LDAP user straight in LDAP server # Start Confluence # The daily report will fail with the following error: {code} 2011-01-17 18:38:56,873 ERROR [DefaultQuartzScheduler_Worker-7] [org.quartz.core.ErrorLogger] schedulerError Job (DEFAULT.DailyReportJob threw an exception. org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: com.atlassian.core.exception.InfrastructureException: 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.quartz.core.JobRunShell.run(JobRunShell.java:210) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) Caused by: com.atlassian.core.exception.InfrastructureException: 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 com.atlassian.hibernate.HibernateObjectDao.remove(HibernateObjectDao.java:166) at com.atlassian.confluence.mail.notification.DefaultNotificationManager.removeNotification(DefaultNotificationManager.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy26.removeNotification(Unknown Source) at com.atlassian.confluence.mail.ChangeDigestNotificationBean.getAllChangeReports(ChangeDigestNotificationBean.java:176) at com.atlassian.confluence.mail.jobs.DefaultDailyReportManager.generateDailyReports(DefaultDailyReportManager.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) .. .. .. Caused by: 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$16.doInHibernate(HibernateTemplate.java:650) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.delete(HibernateTemplate.java:648) at org.springframework.orm.hibernate.HibernateTemplate.delete(HibernateTemplate.java:644) at com.atlassian.hibernate.HibernateObjectDao.remove(HibernateObjectDao.java:160) ... 38 more ~ {code} h5. Findings In Confluence 2.10.3 and 3.3.1, this does not take place because of the following: {code} 2011-01-17 18:19:16,804 WARN [DefaultQuartzScheduler_Worker-6] [atlassian.confluence.mail.ChangeDigestNotificationBean] getAllChangeReports User Test not found for notification com.atlassian.confluence.mail.notification.Notification@110002 (removing notification) {code} h3. Workaround for 3.4.x # Unzip [^CONF-21645-fix.zip] into WEB-INF # Make sure the following exists in your Confluence installation directory #* {{confluence-install/confluence/WEB-INF/classes/com/atlassian/confluence/mail/ChangeDigestNotificationBean.class}} # Restart Confluence

    Atlassian JIRA | 6 years ago | Sashidaran Jayaraman [Atlassian]
    org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: com.atlassian.core.exception.InfrastructureException: 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.]
  2. 0

    h5. Steps to reproduce issue # Integrate Confluence with LDAP # Ensure a local user and an LDAP user have {{Subscribed to daily updates}} # Stop Confluence server # Remove the LDAP user straight in LDAP server # Start Confluence # The daily report will fail with the following error: {code} 2011-01-17 18:38:56,873 ERROR [DefaultQuartzScheduler_Worker-7] [org.quartz.core.ErrorLogger] schedulerError Job (DEFAULT.DailyReportJob threw an exception. org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: com.atlassian.core.exception.InfrastructureException: 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.quartz.core.JobRunShell.run(JobRunShell.java:210) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) Caused by: com.atlassian.core.exception.InfrastructureException: 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 com.atlassian.hibernate.HibernateObjectDao.remove(HibernateObjectDao.java:166) at com.atlassian.confluence.mail.notification.DefaultNotificationManager.removeNotification(DefaultNotificationManager.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy26.removeNotification(Unknown Source) at com.atlassian.confluence.mail.ChangeDigestNotificationBean.getAllChangeReports(ChangeDigestNotificationBean.java:176) at com.atlassian.confluence.mail.jobs.DefaultDailyReportManager.generateDailyReports(DefaultDailyReportManager.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) .. .. .. Caused by: 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$16.doInHibernate(HibernateTemplate.java:650) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.delete(HibernateTemplate.java:648) at org.springframework.orm.hibernate.HibernateTemplate.delete(HibernateTemplate.java:644) at com.atlassian.hibernate.HibernateObjectDao.remove(HibernateObjectDao.java:160) ... 38 more ~ {code} h5. Findings In Confluence 2.10.3 and 3.3.1, this does not take place because of the following: {code} 2011-01-17 18:19:16,804 WARN [DefaultQuartzScheduler_Worker-6] [atlassian.confluence.mail.ChangeDigestNotificationBean] getAllChangeReports User Test not found for notification com.atlassian.confluence.mail.notification.Notification@110002 (removing notification) {code} h3. Workaround for 3.4.x # Unzip [^CONF-21645-fix.zip] into WEB-INF # Make sure the following exists in your Confluence installation directory #* {{confluence-install/confluence/WEB-INF/classes/com/atlassian/confluence/mail/ChangeDigestNotificationBean.class}} # Restart Confluence

    Atlassian JIRA | 6 years ago | Sashidaran Jayaraman [Atlassian]
    org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: com.atlassian.core.exception.InfrastructureException: 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.]

    Root Cause Analysis

    1. com.atlassian.core.exception.InfrastructureException

      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 com.atlassian.hibernate.HibernateObjectDao.remove()
    2. com.atlassian.hibernate
      HibernateObjectDao.remove
      1. com.atlassian.hibernate.HibernateObjectDao.remove(HibernateObjectDao.java:166)
      1 frame
    3. com.atlassian.confluence
      DefaultNotificationManager.removeNotification
      1. com.atlassian.confluence.mail.notification.DefaultNotificationManager.removeNotification(DefaultNotificationManager.java:118)
      1 frame
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    5. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      3 frames
    6. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      1 frame
    7. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      1 frame
    8. com.atlassian.spring
      SpringProfilingInterceptor.invoke
      1. com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
      1 frame
    9. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    10. Unknown
      $Proxy26.removeNotification
      1. $Proxy26.removeNotification(Unknown Source)
      1 frame
    11. com.atlassian.confluence
      DefaultDailyReportManager.generateDailyReports
      1. com.atlassian.confluence.mail.ChangeDigestNotificationBean.getAllChangeReports(ChangeDigestNotificationBean.java:176)
      2. com.atlassian.confluence.mail.jobs.DefaultDailyReportManager.generateDailyReports(DefaultDailyReportManager.java:51)
      2 frames
    12. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames