oracle / oracle/node-oracledb

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

Open
#1,672 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

inactive question
Dominant language
JavaScript
Stars
2.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

  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);
    }
  }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the onModuleInit entry point and the oracleConnection.subscribe call in the supplied script, then verify the reported behavior with the listed node-oracledb and oracledb versions. Reproduce updates from the Java service and repeated visual-tool edits; done means the subscription behavior is explained or consistently reproduced with enough detail to identify the fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.