Transaction : Write operations are not allowed in read-only mode
Asked by Boris:

I'm using a TransactionTemplate as described in the first code block [here](https://developer.atlassian.com/server/confluence/hibernate-sessions-and-transaction-management-guidelines/).

Some customers have reported errors coming from such transaction though I was not able to repeat it.

Error is :
> 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
>
> \[confluence.impl.hibernate.ConfluenceHibernateTransactionManager\] doRollback Performing rollback. Transactions: -\>\[null\]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #600073409) Showing 10 last transactions at this level out of 20 in total: \[com.atlassian.confluence.internal.index.attachment.DefaultAttachmentStatusManager.getAttachmentStatus\]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #1045429045) \[com.atlassian.confluence.internal.index.attachment.DefaultAttachmentStatusManager.getAttachmentStatus\]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #1380275581) \[com.atlassian.confluence.internal.index.attachment.DefaultAttachmentStatusManager.getAttachmentStatus\]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #2145306457) \[com.atlassian.confluence.internal.index.attachment.DefaultAttachmentStatusManager.getAttachmentStatus\]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #134397841) \[com.atlassian.confluence.internal.index.attachment.DefaultAttachmentStatusManager.getAttachmentStatus\]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #1164519608) \[com.atlassian.confluence.internal.index.attachment.DefaultAttachmentStatusManager.getAttachmentStatus\]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #1539868696) \[com.atlassian.confluence.internal.index.attachment.DefaultAttachmentStatusManager.getAttachmentStatus\]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #1980512971) \[com.atlassian.confluence.internal.index.attachment.DefaultAttachmentStatusManager.getAttachmentStatus\]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #305437232) \[com.atlassian.confluence.internal.index.attachment.DefaultAttachmentStatusManager.getAttachmentStatus\]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #1111260812) \[com.atlassian.confluence.internal.index.attachment.DefaultAttachmentStatusManager.getAttachmentStatus\]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #1762050800)

Is there a workaround for this?

Customer is using Confluence DC 6.15.4.


Answers:
author: Shannon S
body: Hello [@Boris Jockov _draw_io_](/t5/user/viewprofilepage/user-id/853350),

Thank you for raising this question. Could you help us to understand exactly what it is you're trying to do?

If you are developing for Confluence, I would recommend raising your question on the [Atlassian Developer Community](https://developer.atlassian.com/resources) instead. They would be better equipped to answer your question there.

Regards,

Shannon

comments: author: Boris
body: Thanks. I've just [posted](https://community.developer.atlassian.com/t/transaction-write-operations-are-not-allowed-in-read-only-mode/32777) there.


Tags: app

atl-dev

confluence-app

confluence-server

data-center

server