Could not extract ResultSet [ERROR: cannot execute nextval() in a read-only transaction]

I am hitting an api which is updating the transaction.
@Transactional
public InboundTransaction updateInboundTransaction(InboundTransaction inboundTransaction)

This method is causing this issue as cannot execute nextval() on a read only transaction.
Please help me with this issue.

How about making the transaction non-readonly?

read only is set to false by default so why this is not working?
JDBC exception executing SQL [delete from drtinboundtransaction where transactionid=?] [ERROR: current transaction is aborted, commands ignored until end of transaction block] [n/a] , these are additional logs. I am using hibernate 6, please help

I don’t know your environment. Maybe you are connecting to a read replica?

Actually when I am using @Transactional(propagation=Propagation.REQUIRED) instead of @Transactional(propagation=Propagation.REQUIREs_NEW) it is working fine, why this is happening?

Ask the Spring community about this. @Transactional is not defined by Hibernate.