2

I am working with Oracle and ODP.Net and registering some continuous query notifications.

Everything worked fine untile the database was upgraded to 11.2.0.3 - now I see that my queries are registered and deregistered after a few seconds. The code looks like this:

        OracleCommand cmd = new OracleCommand();
        cmd.Connection = getOpenConnection();
        cmd.CommandText = _sqlStatement;

        _odep = new OracleDependency(cmd, false, 0, false);

        _odep.OnChange += new OnChangeEventHandler(_odep_OnChange);

        OracleDB.bindVars(ref cmd, arguments);

        cmd.Notification.IsNotifiedOnce = false;
        cmd.ExecuteNonQuery();

Is there a log for CQN registration somewhere on the database?

Edit: getOpenConnection() is just a function that returns an open connection, while OracleDB.bindVars just binds the existing bind variables to the command. Emphasis on the fact that everything worked fine before the DB update :)

4
  • Could you check what you get as a result from SELECT * FROM DBA_CHANGE_NOTIFICATION_REGS (after you registered your notification) Commented Mar 9, 2012 at 6:11
  • Hi Eggi, thanks for you answer. When I execute that sql command, I see that the queries are successfully registered - but they disappear if I repeat the query a minute after. Could it be related to the ODP.Net driver version? Commented Mar 9, 2012 at 13:56
  • Maybe you could try to use 11.2.0.3 (http://www.oracle.com/technetwork/developer-tools/visual-studio/downloads/index.html). Do you even get any notifications? Maybe there was some change regarding a firewall (on the machine that runs the client - because the server connects to the client) or something. Commented Mar 9, 2012 at 14:12
  • I think I can rule out everything that is not related to versioning - the only thing that has changed is the version of Oracle. I will try the 11.2.0.3 as soon as I get my hands back on the machine. Commented Mar 9, 2012 at 16:12

3 Answers 3

2

In the end, it was a problem on the database side - incompatibility caused by registering CQN entries using the 11.2.0.1 Client on a 11.2.0.3 Server.

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

Comments

2

This may not pertain to your specific scenario but anyone having problems with CQN (and AQ) notifications not occuring should upgrade the database. There was a bug in 11.2.0.1 database.

The following SQL causes Oracle to avoid the buggy code path with the older version, but you are advised to upgrade the database:

alter system set events '10867 trace name context forever, level 1';

EDIT: Please note that this is an old bug and the problem is fixed in current patchsets. You will need to patch BOTH the database and ODP.NET to fix it.

Christian Shay

Oracle

1 Comment

It was not actually my case, but thanks for the information - surely it will be useful to someone!
1

+1 for Christian's answer (I don't have the rep to +1 it)

His fix (alter system set events '10867 trace name context forever, level 1') resolved the issue of callback events not firing.

Until that fix was applied I would see the change notification registration enter the USER_CHANGE_NOTIFICATION_REGS table and disappear when a DB change occurred, but no event would be fired.

I am using a 11.2.0.1.0 server and 11.2.0.3.0 client (http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html).

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.