Milllions INSERT queries failed to complete
See original GitHub issueHi 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:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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
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.