Number of messages received by OraclePipe

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
mannalex
Posts: 1
Joined: Mon 04 Apr 2011 10:40

Number of messages received by OraclePipe

Post by mannalex » Mon 04 Apr 2011 10:52

Hello,

the OraclePipe.Receive() method returns a collection of messages. My tests showed that there is never more than a single message in it.

Is the internal implementation really built in a way to unpack more than one message?

Regards,
Alex

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 06 Apr 2011 13:13

Thank you for your report. We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 13 Apr 2011 12:31

A collection of messages is returned when your send messages to the server as a collection:

Code: Select all

    using (OracleConnection conn = new OracleConnection()) {
        conn.ConnectionString = "server=orcl1120;uid=scott;pwd=tiger;";
        conn.Open();
        OraclePipe pipe = new OraclePipe(conn, "test");
        pipe.SendTimeout = 5;
        OraclePipeMessageCollection coll = new OraclePipeMessageCollection();
        coll.Add(new OraclePipeMessage("hello! 1", OracleDbType.VarChar));
        coll.Add(new OraclePipeMessage("hello! 2", OracleDbType.VarChar));
        coll.Add(new OraclePipeMessage("hello! 3", OracleDbType.VarChar));
        pipe.Send(coll);
    }
    using (OracleConnection conn = new OracleConnection()) {
        conn.ConnectionString = "server=orcl1120;uid=scott;pwd=tiger;";
        conn.Open();
        OraclePipe pipe = new OraclePipe(conn, "test");
        pipe.ReceiveTimeout = 5;
        OraclePipeMessageCollection collection = pipe.Receive();
        for (int i = 0; i < collection.Count; i++) {
            Console.WriteLine(collection[i].Value);
        }
        Console.ReadLine();
    }

Post Reply