Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When another Java-based service updates Oracle tables, the changes are not being detected by my subscription mechanism. #1672

Open
siisiooy opened this issue May 11, 2024 · 1 comment
Labels

Comments

@siisiooy
Copy link

  1. What versions are you using?
 "node-oracledb": "^1.0.2",
 "oracledb": "^6.3.0",
 "@nestjs/typeorm": "^10.0.2",
  1. Describe the problem

I'm encountering an issue with subscribing to Oracle table changes using Nest.js. When another Java-based service updates Oracle tables, the changes are not being detected by my subscription mechanism. A dditionally, in my local testing environment, using a visual tool to directly modify the tables, only the first change triggers the subscription event. Subsequent changes do not trigger the event unless I completely close the visual tool and reopen it before making another update.

  1. Include a runnable Node.js script that shows the problem.
async onModuleInit() {
    try {
      const { username, password, host, port, serviceName, database, connectString } = config;
      oracledb.initOracleClient();

      this.oracleConnection = await oracledb.getConnection({
        user: username,
        password,
        connectString,
        events: true,
      });

      async function handleTableChanges(message) {
        console.log('Table changes:', message.tables);
      }

      const options = {
        sql: `SELECT * FROM ${database}.LIM_TABLE`,
        callback: handleTableChanges,
        clientInitiated: false,
      };

      console.log('Subscribing oracle options: ', options);
      await this.oracleConnection.subscribe(
        'lims_changes',
        options,
      );
    } catch (error) {
      this.logger.error(error);
    }
  }
@sharadraju
Copy link
Member

Hi @siisiooy
Thanks for using node-oracledb.
We will look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants