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

Internal error with multiple CQN subscriptions using the same name #1718

Open
jogold opened this issue Jan 6, 2025 · 3 comments
Open

Internal error with multiple CQN subscriptions using the same name #1718

jogold opened this issue Jan 6, 2025 · 3 comments
Labels

Comments

@jogold
Copy link

jogold commented Jan 6, 2025

  1. What versions are you using?

oracle: 19.0.0.0.ru-2023-10.rur-2023-10.r1
platform: linux
version: 22.12.0
arch: x64
require('oracledb').versionString: 6.7.1
require('oracledb').oracleClientVersionString: 21.16.0.0

  1. Describe the problem

Getting the error: internal error in file ../src/njsConnection.c, line 2490 (no error message) when trying to create multiple CQN subscriptions using the same name.

If I call connection.subscribe() only once I have no issues.

The same code runs fine in v5.5.0

  1. Include a runnable Node.js script that shows the problem.
const oracledb = require('oracledb');
oracledb.initOracleClient();

const interval = setInterval(() => null, 5000);

async function cqnCallback(message) {
  console.log(message);
}

const subscriptions = [
  'SQL1',
  'SQL2',
];

async function main() {
  let connection: oracledb.Connection | undefined;
  try {
    connection = await oracledb.getConnection(connectionAttributes);
    for (const subscription of subscriptions) {
      await connection.subscribe('cqn', {
        callback: cqnCallback,
        port: 5000,
        timeout: 24 * 60 * 60, // 24 hours
        qos: oracledb.SUBSCR_QOS_QUERY | oracledb.SUBSCR_QOS_ROWIDS,
        sql: subscription,
        operations: oracledb.CQN_OPCODE_INSERT | oracledb.CQN_OPCODE_UPDATE,
      });
    }
  } catch (err) {
    console.log(err);
    clearInterval(interval);
  } finally {
    if (connection) {
      try {
        await connection.close();
      } catch (err) {
        console.log(err);
      }
    }
  }
}
@jogold jogold added the question label Jan 6, 2025
@sharadraju
Copy link
Member

sharadraju commented Jan 7, 2025

Thanks @jogold for reporting this.
One quick question:
Is your Oracle Database docker or on-prem?
Please run connection.oracleServerVersion in your program to provide us the exact Oracle Database version.

@jogold
Copy link
Author

jogold commented Jan 7, 2025

Is your Oracle Database docker or on-prem?

It is hosted on AWS RDS.

connection.oracleServerVersion is 1921000000.

@sudarshan12s sudarshan12s added bug and removed question labels Jan 14, 2025
@sudarshan12s
Copy link

Thanks @jogold . We are able to reproduce issue. We will share the fix details.

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

3 participants