1

I'm complete newbie to Oracle DB trying to enable DB change notifications.

private void RegisterNotification()
    {
        const string connstring = "Data Source=ORA_DB;User Id=USER;Password=pass;";
        try
        {
            var connObj = new OracleConnection(connstring);
            connObj.Open();
            var cmdObj = connObj.CreateCommand();
            cmdObj.CommandText = "SELECT * FROM MYTABLE";
            var dep = new OracleDependency(cmdObj);
            dep.QueryBasedNotification = false;
            dep.OnChange += new OnChangeEventHandler(OnNotificationReceived);
            cmdObj.ExecuteNonQuery();
            connObj.Close();
            connObj.Dispose();
            connObj = null;
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
    }

public static void OnNotificationReceived(object src, OracleNotificationEventArgs arg)
    {
        MessageBox.Show("Table has changed!");
    }

I've executed "GRANT CHANGE NOTIFICATION TO USER;" but nothing happens when I change the table data neither manually nor programmatically. Query-based notifications also don't work. I suppose I miss something in Oracle configuration.

I have Oracle 11.2 standard edition.

2 Answers 2

1

The CHANGE NOTIFICATION permission is not on the features of the Standard Edition for latest versions : Licensing information

Oracle TimesTen Application-Tier Database Cache :

Data access using PL/SQL, JDBC, ODBC, ttClasses, OCI, and Pro*C/C++

interfaces Transaction Log API (XLA) for change notification

Multi-node Cache Grid

...

SE2 : N

EE : Y (extra-cost option)

Sign up to request clarification or add additional context in comments.

Comments

0

Try to execute your soft under admin permission and as console application. when we used to deal with it we faced with the same stuff. we hadn't managed to use it in webservices.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.