2

We want to implement Oracle Database Continuous Query Notification in a multiple cluster environment . But what we desire is that the DB change notification should be sent to only one instance of the application , because as of now it sending the change notification to all of the instance. How do I get the desired characteristic. My listener code is as

 DCNDemoListener list = new DCNDemoListener(this);
            dcr.addListener(list);

            // second step: add objects in the registration:
            Statement stmt = conn.createStatement();
            // associate the statement with the registration:
            ((OracleStatement)stmt).setDatabaseChangeRegistration(dcr);
            ResultSet rs = stmt.executeQuery("select * from testtable where ID=1");

Properties :

OracleConnection conn = connect();

        // first step: create a registration on the server:
        Properties prop = new Properties();
        prop.setProperty(OracleConnection.DCN_NOTIFY_ROWIDS,"true");
        prop.setProperty(OracleConnection.DCN_QUERY_CHANGE_NOTIFICATION,"true");
        DatabaseChangeRegistration dcr = conn.registerDatabaseChangeNotification(prop);
James Z
  • 12,209
  • 10
  • 24
  • 44
Manas Pratim Chamuah
  • 1,527
  • 2
  • 15
  • 33

0 Answers0