Closed michel-reyes closed 7 years ago
Hi there - there was an issue with insert query, now it is solved. You can grab the latest version (1.2.5) and use. Let me know if you are getting this issue any more.
Thanks
Sorry, the problem persist
RangeError: Maximum call stack size exceeded at h (JsStore-1.2.5.min.js:4)
Here is part of my code
conn.insert({
Into: 'locations',
Values: locations, // this is a array of objects a 6 Mib file
OnSuccess: function(rowsAffected) {
if (rowsAffected > 0) {
console.log('Succesfully added ' + rowsAffected + ' row(s)');
}
},
OnError: function(err) {
console.log(err.value);
}
});
The new version is 1.2.5 . Are you using this version ?
Yes I'm using the lastest version, I edit the post. It is the 1.2.5 version and is the same problem.
Can use 'SkipDataCheck' to see the problem persist
conn.insert({
Into: 'locations',
Values: locations, // this is a array of objects a 6 Mib file
SkipDataCheck:true, // will not do any validation just insert data
OnSuccess: function(rowsAffected) {
if (rowsAffected > 0) {
console.log('Succesfully added ' + rowsAffected + ' row(s)');
}
},
OnError: function(err) {
console.log(err.value);
}
});
If you want to make the insertion more faster use bulkinsert - http://jsstore.net/tutorial/bulk_insert
Not yet. If I use SkipDataCheck it says: "Table 'locations' does not exist" otherwise: Maximum call stack size exceeded
Not yet. If I use SkipDataCheck it says: "Table 'locations' does not exist"
otherwise: Maximum call stack size exceeded
`
// helper funtions // milliseconds to seconds to log the function's performance function performanceLog(fun, m) { return console.log("Load " + fun + " took " + m.toFixed(2) + " milliseconds / " + (m/1000).toFixed(2) + " seconds."); }
// Enable db library logs //JsStore.enableLog();
// global vars var table, dbName = 'gls', db, conn, t1, t0;
//--------------------------------
conn = new JsStore.Instance(); JsStore.isDbExist(dbName,function(isExist){ if(isExist) { console.log('Db already created'); conn.openDb(dbName);
console.log('populate table');
populateTable();
}
else
{
console.log('Db does not exist, creating..');
table = {
Name: 'locations',
Columns: [
{
Name: 'State',
DataType: 'string'
},
{
Name: 'City',
DataType: 'string'
},
{
Name: 'CountryCode',
DataType: 'string'
},
{
Name: 'PayerCode',
DataType: 'string'
},
{
Name: 'BranchCode',
DataType: 'string'
},
{
Name: 'Street',
DataType: 'string'
}
]
};
db = {
Name: dbName,
Tables: [table]
};
conn.createDb(db, function(){
console.log('Db created successfully');
console.log('populating table');
populateTable();
console.log('populated table');
});
}
});
//------------------
function populateTable() {
conn.insert({
Into: 'locations',
Values: locations, // this is a array of objects a 6 Mib file
SkipDataCheck:true, // will not do any validation just insert data
OnSuccess: function(rowsAffected) {
if (rowsAffected > 0) {
console.log('Succesfully added ' + rowsAffected + ' row(s)');
}
},
OnError: function(err) {
console.log(err.value);
}
});
}
`
May I know - In which browser you are working ?
Chrome Version 61.0.3163.100 (Official Build) (64-bit)
ok thanks. please use the same code in incognito with skipdatacheck on . Let me know what is the result.
It may be that db has became buggy due to exception thrown.
Can you please upload your code on jsfiddle or something like this or you can give me files. It will be more helpful.
Perfect! But not for the incognito mode, I update my chrome browser to version 62, and everything works great. I'm afraid if the old browsers can't work as well
Trying in IE....
great ! it should work in older version too even in incognito. Is chrome incognito not working for you ?
Ok, I'm going to clean my browser, restart my PC to try to replicate the error again
yeah cleaning the storage should work. Make sure you are not seeing any db in indexeddb tab.
@neomicho85 - is it working fine for other browsers? or is there any problem ?
Can we close this issue if everything good?
I try in ie10, chrome 61 and 62 everything's ok. Thx
Hi, I try to create a insert statement from a huge (40000 records) and then I get the Maximum call stack size exceeded. How can I solve this?