org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.

Stack Overflow | Harpreet | 7 months 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

    Hibernate5, Spring 4 - org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread

    Stack Overflow | 7 months ago | Harpreet
    org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
  2. 0

    Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition

    Stack Overflow | 5 months ago | Rohit
    org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.

    2 unregistered visitors

    Root Cause Analysis

    1. org.springframework.dao.InvalidDataAccessApiUsageException

      Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.

      at org.springframework.orm.hibernate5.HibernateTemplate.checkWriteOperationAllowed()
    2. org.springframework.orm
      HibernateTemplate.save
      1. org.springframework.orm.hibernate5.HibernateTemplate.checkWriteOperationAllowed(HibernateTemplate.java:1132)
      2. org.springframework.orm.hibernate5.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:618)
      3. org.springframework.orm.hibernate5.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:615)
      4. org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:340)
      5. org.springframework.orm.hibernate5.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:307)
      6. org.springframework.orm.hibernate5.HibernateTemplate.save(HibernateTemplate.java:615)
      6 frames
    3. hibernate.test
      InsertTest.main
      1. hibernate.test.EmployeeDao.saveEmployee(EmployeeDao.java:12)
      2. hibernate.test.InsertTest.main(InsertTest.java:21)
      2 frames