Page 1 of 1

Number of messages received by OraclePipe

Posted: Mon 04 Apr 2011 10:52
by mannalex
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

Posted: Wed 06 Apr 2011 13:13
by Shalex
Thank you for your report. We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

Posted: Wed 13 Apr 2011 12:31
by Shalex
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();
    }