Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9272079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:46:54+00:00 2026-06-18T15:46:54+00:00

I am trying to get a test application to work using Oracle Change Notification

  • 0

I am trying to get a test application to work using Oracle Change Notification with C#, but I am not receiving the callback notification in my application. Oracle DB version is 11.2.0.1.0. Oracle.DataAccess v.2.112.30. I can confirm the query gets registered in Oracle by viewing SYS.USER_CHANGE_NOTIFICATION_REGS and SYS.USER_CQ_NOTIFICATION_QUERIES. However, nothing ever appears in SYS.DBA_CHANGE_NOTIFICATION_REGS.

The registration persists until I commit a transaction on the table. The registration disappears after a few seconds after the commit and my application does not received the notification.

I have made sure my computer is listening on the correct port and have even tried turning off any firewall that could be blocking the port.

I do have GRANT CHANGE NOTIFICATION to MYSCHEMA, GRANT EXECUTE ON DBMS_CHANGE_NOTIFICATION TO MYSCHEMA, and the JOB_QUEUE_PROCESSES is set to 1.

Questions:

1) Should the registration be visible in SYS.DBA_CHANGE_NOTIFICATION_REGS and, if so, what could be causing it not to be when it is visible in SYS.USER_CHANGE_NOTIFICATION_REGS and SYS.USER_CQ_NOTIFICATION_QUERIES?

2) What could be causing the registration to disappear after a commit?

3) What could be causing the failure of the notification to my application?

Here is the C# code I am using and it is basically the same as from the Oracle website:

using System;
using System.Threading;
using System.Data;
using Oracle.DataAccess.Client;

namespace NotifyTest
{
    public class Program
    {
        public static bool IsNotified = false;

            public static void Main(string[] args)
        {
            string constr = "User Id=mySchema;Password=myPassword;Data Source=myOracleInstance";

            OracleDependency dep = null;

            try
            {
                using (var con = new OracleConnection(constr))
                {
                    Console.WriteLine("Registering query...");
                    var cmd = new OracleCommand("select * from mySchema.NOTIFY_TEST", con);
                    con.Open();

                    OracleDependency.Port = 1005;
                    dep = new OracleDependency(cmd);
                    dep.OnChange += OnMyNotificaton;

                    int queryRegistered = cmd.ExecuteNonQuery();

                    // If oracle returns -1, then the query is successfully registered
                    if (queryRegistered == -1)
                    {
                        Console.WriteLine("Query Registered...");
                        Console.WriteLine("Listening for Callback...");
                    }
                    else
                    {
                        Console.WriteLine("There was an error...");
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            // Loop while waiting for notification       
            while (IsNotified == false)
            {
                Thread.Sleep(100);
            }
        }

        public static void OnMyNotificaton(object sender, OracleNotificationEventArgs arg)
        {
            Console.WriteLine("Table change notification event is raised");
            Console.WriteLine(arg.Source.ToString());
            Console.WriteLine(arg.Info.ToString());
            Console.WriteLine(arg.Source.ToString());
            Console.WriteLine(arg.Type.ToString());
            IsNotified = true;
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:46:55+00:00Added an answer on June 18, 2026 at 3:46 pm

    Just wanted to provide an update as to how I resolved this issue. I changed my Oracle.DataAccess.dll from v.2.112.3.0 to v.2.112.1.2 and it works fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a test application running using MVC WEB API but i
I am trying to test a sinatra app using minitest and capybara but get
I'm trying to get Thinking Sphinx to work in test mode in Rails. Basically
I'm trying to make a very simple OSGi test but I can't get it
I'm trying to unit test, using VS unit testing facility following method. void Get(string
I'm trying to get the RSpec-tests of my Rails application back to work. As
I'm trying to get a cross domain call to work using JSONP within JQuery.
I was trying to get some tests running inside a console application using System;
I'm trying to test an application that runs on App Engine. I'm using the
I'm trying to get an application up and running, but I'm hitting this issue

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.