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 | Rohit | 6 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

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

    Stack Overflow | 6 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. 0

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

    Stack Overflow | 8 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 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:1126)
      2. org.springframework.orm.hibernate5.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:619)
      3. org.springframework.orm.hibernate5.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:616)
      4. org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:341)
      5. org.springframework.orm.hibernate5.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:309)
      6. org.springframework.orm.hibernate5.HibernateTemplate.save(HibernateTemplate.java:616)
      6 frames
    3. com.hbtemp.dao
      StudentDaoImpl.insertStudent
      1. com.hbtemp.dao.impl.StudentDaoImpl.insertStudent(StudentDaoImpl.java:22)
      1 frame
    4. com.hbtemp.test
      TestClass.main
      1. com.hbtemp.test.TestClass.main(TestClass.java:25)
      1 frame