Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2013
    Posts
    3

    Unanswered: Specified registration id does not exist

    Hello Oracle Community
    My problem is that my Java application suddenly gets an error. (ORA-29970: Specified registration id does not exist) The source code already worked smoothly. I fear that many of my DataBaseChangeNotification - Registrations in testing mode crashed the database. But I have almost the same code in C#, and the registration is working properly.

    My target is setting a trigger to the db to listen on an insert, update, or delete-command. In summary: in C# it works, but not in java. At least it have to be a java application.

    Code:
    Class.forName("oracle.jdbc.OracleDriver");
                 System.out.println("driver loaded successfully!");
                 //jdbc:oracle:thin:@ IP :1521: SID" , USER, PW
                 conn = (oracle.jdbc.driver.OracleConnection) DriverManager.getConnection(dbConst.connstr, dbConst.usr, dbConst.pwd);             
                 System.out.println("connection established!");
                 //Trigger          
                 final Properties dbProperties = new Properties();
                 dbProperties.setProperty(oracle.jdbc.driver.OracleConnection.DCN_NOTIFY_ROWIDS, "true");
                 dbProperties.setProperty(oracle.jdbc.driver.OracleConnection.DCN_QUERY_CHANGE_NOTIFICATION, "true");
                 DatabaseChangeRegistration dbChangeRegistration = conn.registerDatabaseChangeNotification(dbProperties);
                 DBListener listener = new DBListener();  
                 dbChangeRegistration.addListener(listener);
                 OracleStatement cmd = (OracleStatement)conn.createStatement();
                 //select Table for Listener
                 String cmdtext = "select * from TB";          
                 //associate the statement with the registration
                 ((OracleStatement) cmd).setDatabaseChangeRegistration(dbChangeRegistration);
                 cmd.executeQuery(cmdtext);
    Bold Line occurs an error.

    Code:
    class DBListener implements DatabaseChangeListener {
        
        @Override
        public void onDatabaseChangeNotification(oracle.jdbc.dcn.DatabaseChangeEvent e) {
            try {
                /*QueryChangeDescription[] qcd = e.getQueryChangeDescription();
                long rowID = qcd[0].getQueryId();
                TableChangeDescription[] tcd = qcd[0].getTableChangeDescription();
                String table = tcd[0].getTableName();
                //jdbc:oracle:thin:@ IP :1521: SID" , USER, PW
                OracleConnection connDCN = (OracleConnection) DriverManager.getConnection(dbConst.connstr, dbConst.usr, dbConst.pwd);
                System.out.println("connection established!");
                connDCN.close();
                System.out.println(rowID);
                System.out.println(table.toString());*/            
            } catch(Exception ex){System.out.println(ex.getMessage().toString());}
        }       
    }
    Same in C# - code works :

    Code:
    oSQLConn.ConnectionString = Properties.Settings.Default.ConnectionString;
                    oSQLConn.Open();
                    Console.WriteLine("Connected");
                    Console.WriteLine("Trigger . . .");
                                
                    OracleCommand oSQLCommand = new OracleCommand();
                    oSQLCommand.Connection = oSQLConn;
                    oSQLCommand.CommandText = "select * from TB"; /
                    OracleDependency OraDep = new OracleDependency(oSQLCommand);
                    OraDep.OnChange+=OraDep_OnChange;                
                    oSQLCommand.Notification.IsNotifiedOnce = false;
                    oSQLCommand.AddRowid = true;
                    oSQLCommand.ExecuteNonQuery();
    Hope someone can help me Thanks!

  2. #2
    Join Date
    Mar 2013
    Posts
    3
    Investigating more about the error I mentioned, I found a pattern when the error is seen. If the application registers for database change notification and aborts before un-registering, the next attempt to register would fail with "ORA-29972: user does not have privilege to change/ create registration" and further attempts will fail with an error "ORA-29970: Specified registration id does not exist".

    A real example of the above situation where the application aborts before un-registering could be power failures or network failures. I think I had such a network fail during my app testing.

    In addition to above, I also observed that when such a scenario occurs the registrations are purged by the database server after a particular amount of time. Can someone throw some insights on what is the time interval after which the database server purges the invalid registrations? Or, how can I manually delete the registration in the DB. Cause there are no entries in the "DBA_CHANGE_NOTIFICATION_REGS" ...

  3. #3
    Join Date
    May 2013
    Posts
    4
    Hi HaTcHeT,

    I am also getting the same problem like

    "ORA-29970: Specified registration id does not exist".

    if you have resolved please let me know. I am trying from last few days but still not able to get the solution.

    thanks in advance.

  4. #4
    Join Date
    Mar 2013
    Posts
    3
    Did you get a solution for this error? Maybe by restarting the Oracle DB?
    I hadn't worked on my project since last month, but now I need an advice

    thx

  5. #5
    Join Date
    May 2013
    Posts
    4
    thanks for the replay

    No, I didn't restart the db yet. still i am getting the same error in my environment.

    still I am waiting for the soulution, if anyone know plz help me out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •