Oracle Error ORA-24196: access the message in a wrong access mode

Oracle Error Message

ORA-24196: access the message in a wrong access mode

Reason for the Error

StreamMessage and BytesMessage could not be read when they were in write only mode and vice versa.

Solution

Change the access mode using PREPARE, CLEAR_BODY and RESET procedures.