question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Milllions INSERT queries failed to complete

See original GitHub issue

Hi team,

I have a function in my system which will insert the data to the database using the querySync API The function is executed once it received the data and I have millions of data to be inserted to database

However, the system stopped suddenly in between after only about 35000 data being inserted without any error message prompted out

I also using the try-catch to skip data that unable to be inserted

I’m not using pool because I’m trying to avoid using callbacks. I’m not sure whether this is the main reason

Can you help me solve this problem?

Thank you.

Edit 1: Below is the function:

const write = (data) => {
    conn = getConnection();
    const { colNames, dataValues } = getDataValues(data);
    const qryString = `INSERT INTO schema.${config.table} ${colNames} VALUES (${dataValues.toString()})`;

    try {
      const result = conn.querySync(qryString);
      console.log(`result: ${result}`);
    } catch (e) {
      console.log('error write ', e.message);
    }
};

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
agovcommented, Aug 3, 2017

@yiemszx can you monitor the available transaction log and number of applications during your application runtime? Wondering if connections are closed properly and the statements are committed

0reactions
bimalkjhacommented, Sep 7, 2017

Fixed with latest code on github. Please install latest code using npm install git+https://git@github.com/ibmdb/node-ibm_db.git command and test the fix for non-windows platform. For windows, wait till next release. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sudden Insertion Error to a 3 years old table with 5 million of ...
Suddenly Database table stopped inserting a record. while record exists in parent table and record insertion is same in child table as It ......
Read more >
How to execute more than 1 million insert queries in Oracle ...
I will suggest you to put all the inserts in a .sql and copy over to the database server and run it from...
Read more >
when you have millions of insert statements in a file...
Let's say you have a script of one million of insert statements with literal values. Of course, this is a bad idea. SQL...
Read more >
How to run 2 million insert statements - SQL Server Forums
Now everytime i load the entire script into SQL Server query analyser and execute it, it gives the insufficient memory error.
Read more >
Bulk Insert for 10 million records - Error - Snap shot too old
Hi I am trying to use "Bulk Insert" for inserting 10 million records. This piece of code is placed in the procedure.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found