3 Replies Latest reply: Apr 22, 2011 4:32 AM by 857124 RSS

    removing all DataChangeNotifications

      I need a Java client to remove all DataChangeRegistrations that currently exist in the database. The DataChangeRegistrations (and their DataChangeNotification objects) were previously created by other Java clients whose JVMs were killed before they had a chance to unregister their DCNs. I tried to remove the DCN's in two ways, both which cause SQLExceptions to be thrown.

      I get the registration ids like this:
      pstmt = conn.prepareStatement("SELECT REGID from user_change_notification_regs");

      Then once I have them I tried one of the below options:

      1) conn.unregisterDatabaseChangeNotification(registration_id);
      This causes a "java.sql.SQLException: Unsupported feature" exception in
      at oracle.jdbc.driver.PhysicalConnection.doUnregisterDatabaseChangeNotification(PhysicalConnection.java:10278)

      2) DatabaseChangeRegistration dcr = conn.getDatabaseChangeRegistration(registration_id); //and then...
      This cases a "Exception in thread "main" java.lang.NullPointerException" in

      Are these commands supposed to work? Is there some other way I should be removing the DCN's?