Error Class 25: Invalid Transaction State

Error Class 25: Invalid Transaction State
SQLSTATE Message Text
25001 Cannot close a connection while a transaction is still active.
25001.S.1 Invalid transaction state: active SQL transaction.
25501 Unable to set the connection read-only property in an active transaction.
25502 An SQL data change is not permitted for a read-only connection, user or database.
25503 DDL is not permitted for a read-only connection, user or database.
25505 A read-only user or a user in a read-only database is not permitted to disable read-only mode on a connection.