C# - Oracle Advanced Queue: rows ere not queued until recycling pool application

132 Views Asked by At

I'm using a TransactionScope to perform some operation both with Entity Framework and Oracle Advanced Queue. In local machine i don't have problem, some of my collegues do. Problems happen in the production machine. The problem is that when i enqueue a message it seems not to be inserted into the table queue. After the application pool of IIS times out or making a manual recycle the rows appear into the table.

    using (var ctx = new EFContext())
    {
            using (var ts = new TransactionScope())
            {
                // Perform some EF operations
                ctx.SaveChanges();

                MyEnqueuer enq = new Enqueuer();
                enq.Enqueue();

                ts.Complete();
            }
    }

The method of MyEnqueuer class:

 using (var _cn = new Oracle.DataAccess.Client.OracleConnection(_cs))
{
    using (OracleAQQueue _queueObj = new OracleAQQueue(_queueCs, _cn))
    {
        _cn.Open();
        _queueObj.MessageType = OracleAQMessageType.Raw;
        OracleAQMessage _msg = new OracleAQMessage();
        _msg.Payload = _evento.ToByteArray();
        _queueObj.EnqueueOptions.Visibility = OracleAQVisibilityMode.OnCommit;
        _queueObj.Enqueue(_msg);
        _cn.Close();
    }
}       

As I have said, when ts.Complete is executed, nothing happens in the oracle queue. Row are inserted when iis pool application is recycled or timed out.

In local i have IIS 10, instead in production i have a IIS 6.1 on a Windows Server 2008 R2

I'm using .Net Framework 4.5 and the application is compiled x64. EntityFramework uses Oracle ManagedDataAccess and, as you can see, AOQ uses Oracle DataAccess Client.

Note. The problem stay in the web application becuase, creating a console application of test, everything works.

0

There are 0 best solutions below