'Collection type for payload data type MSG_TYPE does not exist.'

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
storm
Posts: 1
Joined: Wed 28 Nov 2018 10:44

'Collection type for payload data type MSG_TYPE does not exist.'

Post by storm » Wed 28 Nov 2018 10:52

Hi *,

i am dequeueing an Oracle Advanced Queue succesfully through the following code:

Code: Select all

OracleQueue oracleDequeueQueue = new OracleQueue("QUEUENAME", oracleConnection);
OracleQueueMessage msg = oracleDequeueQueue.Dequeue();

if (msg != null && msg.ObjectPayload != null)
{
    Convert.ToString(msg.ObjectPayload["ID"])
}
When i try to gather a queue array through the next code snippet, i am receiving the error message
System.Exception: 'Collection type for payload data type MESSAGE_TYPE_NAME does not exist.'

Code: Select all

OracleQueue oracleDequeueQueue = new OracleQueue("QUEUENAME", oracleConnection);
OracleQueueMessage[] msgArr = oracleDequeueQueue.DequeueArray(10);

foreach (OracleQueueMessage m in msgArr)
{
    if (m != null && m.ObjectPayload != null)
    {
        Convert.ToString(m.ObjectPayload["ID"]));
    }
}
Whats wrong with my code?

best regards

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: 'Collection type for payload data type MSG_TYPE does not exist.'

Post by Pinturiccio » Wed 05 Dec 2018 10:42

We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: 'Collection type for payload data type MSG_TYPE does not exist.'

Post by Pinturiccio » Mon 21 Jan 2019 14:25

When you use the DequeueArray method, you must have the following array type in Oracle:

Code: Select all

CREATE OR REPLACE TYPE MESSAGE_ARRAY AS
VARYING ARRAY (100) OF MESSAGE_TYPE_NAME;
Please note that length of the array of MESSAGE_TYPE_NAME created in Oracle should be equal or greater then the value of the parameter in the DequeueArray method in your .NET code. We will update our documentation with the corresponding information.

Post Reply