Git Product home page Git Product logo

Comments (6)

TimelordUK avatar TimelordUK commented on September 24, 2024

thanks for letting me know. Yes, looks like driver is trying to run two queries at the same time on the same statement, which is not good news. It may take me a few days to track down, I will report back when I dig into it further.

from node-sqlserver-v8.

TimelordUK avatar TimelordUK commented on September 24, 2024

if you are in a position to do so, could you explain the code a little i.e. what is the stored procedure doing, is it a simple select ....

im msnodesqlv8.driverMgr.js, could you run your test with a trace on

what I am passing in for queryId with your test running. In theory, each queryId should be managed entirely independently to all others on their own statements. My first guess is that I am not doing that correctly. Any additional information would be much appreciated.

function procedure_internal(queryId, procedure, params, callback) {

    function onProc(err, results, params) {
        if (callback) {
            callback(err, results, params);
        }
    }
    //noinspection JSUnresolvedFunction
    return native.callProcedure(queryId, procedure, params, onProc);
}

from node-sqlserver-v8.

davazp avatar davazp commented on September 24, 2024

@TimelordUK I tried with multiple procedures, and the only requirement was for it to raise an error.

For instance,

create procedure test 
as begin
	   RAISERROR ('error', 16, 1);
end

would make it. However, the bug is there even when the stored procedure does not exist at all. So the query needs to fail.

I'll do some testing in msnodesqlv8.driverMgr.js later today. Thanks!

from node-sqlserver-v8.

TimelordUK avatar TimelordUK commented on September 24, 2024

so far I have tried to implement the same sort of test directly over msnodesqlv8

I have run many times on a single connection and it seems to run fine

I of course am not saying therefore it is not msnodesqlv8, I just want to try and isolate the test case else I will have to run yours via mssql to reproduce it.

[96] {
"error": {
"sqlstate": "42000",
"code": 50000
}
}
[97] {
"error": {
"sqlstate": "42000",
"code": 50000
}
}
[98] {
"error": {
"sqlstate": "42000",
"code": 50000
}
}
[99] {
"error": {
"sqlstate": "42000",
"code": 50000
}
}

private storedProcedureStress(procedureDef:StoredProcedureDef, params:any) : Promise<any> {
    let inst = this;
    return new Promise((resolve, reject) => {
        ASQ().runner(function*() {
            let connection = yield inst.sqlWrapper.open();
            let array:any = [];

            yield inst.createProcedureDef(procedureDef);
            let count = 100;
            for (let i=0; i<count; i++){
                array.push(i);
            }

            let raised = 0;
            let promises = array.map((i:any)=> {
                let command = connection.getCommand().procedure(procedureDef.name).params(params);
                // test should raise an error, or just don't exist at all
                return command.execute().catch((err: any) => {
                    console.log(`[${raised}] ${JSON.stringify(err, null, 2)}`);
                    ++raised;
                });
            });

            Promise.all(promises).then( ()=> {
                resolve();
            }).catch((e:any)=> {
                reject(e);
            });
        });
    });
}

from node-sqlserver-v8.

TimelordUK avatar TimelordUK commented on September 24, 2024

This issue should now be resolved in 0.2.16 available on npm. The statement was not terminated correctly after raiseerror.

from node-sqlserver-v8.

davazp avatar davazp commented on September 24, 2024

It worked for me as well. Thanks.

from node-sqlserver-v8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.