Onchange event called many times per change on table.

Jan 14, 2016 at 2:24 PM
hello.

i have a problema in my OracleTableDependency.

when i change a record in my table, the OracleTableDependency' instance call the onchange event many times. i do not know why it is happend.

do i need a specific configuration to the instance?

any help is aprecciated.

It is my code:
          var connectionString = ConfigurationManager.ConnectionStrings[_connectionName].ConnectionString;

        _table = new OracleTableDependency<T>(connectionString);            

        _table.OnChanged += (o, e) =>
        {              
                var op = NotificationType.None;

                if (e.ChangeType == ChangeType.Delete) op = NotificationType.Deleted;
                else if (e.ChangeType == ChangeType.Insert) op = NotificationType.Insert;
                else if (e.ChangeType == ChangeType.Update) op = NotificationType.Updated;

                if (op != NotificationType.None)
                {
                    var ev = new NotificationEvent<T>(e.Entity, op);

                    _bus.PublishAsync(ev);
                }              
        };

        _table.OnError += (o, e) =>
        {
            var ev = new NotificationErrorEvent<T>(e.Error, e.Message);

           _bus.PublishAsync(ev);
        };
Jan 14, 2016 at 3:15 PM
Hello

Can you send to my personal email address a ZIP file containing the solution with the problem you reported me?
Because I need more detail to help you.

christian.delbianco@gmail.com

Thanks
Jan 14, 2016 at 5:30 PM
Be aware that if your SQL script update or delete more than one row, you will receive more OnChange events.