on 2016 Aug 24 6:50 PM
Hello Dev,
i am working on one ui5 Application Currently i am using XSJS service for Inserting and Updating Huge Amount ( 20 - 50 Thousand Records ) ,But it seems there is issue with Socket time Connection,So i want to do this in Odata using Batch Operation,
I understand that I can Should use
var batchChanges = [];
batchChanges.push( batchModel.createBatchOperation("/entity", "POST", DATA[] );
batchModel.submitBatch(function(data) {
batchModel.refresh();
for Inserting Thousand of Records in one go without any TimeOut Connection Error !
But i am not getting how could i Update the Thousands of records using Batch PUT Operation ?
i have found something.
But i am bit confuse that which one is the Where clause condition? i want to update the records on the basis of fieldname1 which is not a keyfield in the HANA DB TABLE
batchChanges.push(model.createBatchOperation( "/entity( fieldname1='" + data 1 + "',fieldname2=" + data 2+ "), "PUT",data [] )
is this is the right way?
Request clarification before answering.
Shardul,
are you trying to update that many records from the UI ?? i have not heard of such scenario... alternatively, is there any other way to identify all these records in a simpler fashion.. then on the db you could do your mass update?
just a thought
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes ,i am pulling these records from third party API using AJAX get Method, than on success i want to insert these records in our Hana DB, i was using XSJS but XSJS is having Socket Timeout Issue, which can be extend upto 5 minutes only. but this processing taking more time because there is some validation as well which i am performing.. so thats why i want to upload and update that many records using ui frontend using Batch operation that is the only way left atleast it will not give me socket timeout connection ..
do you know any other way to insert and update that many records ?
Hello Sergio, thanks for your valuable suggestion
I am using batch Insertion do you have any clue i am getting this error " HTTP Request Failed "
After that i put Header ,but data is coming in Json Format.
oModel.setHeaders({
"X-Requested-With": "XMLHttpRequest",
"Content-Type": "application/http",
"DataServiceVersion": "2.0"
}); }
Than it is showing this error NO Handle for data.
thanks for your reply,
this is the error " HTTP Request Failed " in Log but then i added the header
oModel.setHeaders({
"X-Requested-With": "XMLHttpRequest",
"Content-Type": "application/http",
"DataServiceVersion": "2.0"
}); }
iam getting the data in Json format so i should use "Content-Type": "application/json", instead of Content type application/http" , but than it is still showing HTTP Request Failed '
and if i am going with Content type application/http" than it is showing NO Handle for data. as you can see in the screenshot i have attached.
in both cases i am getting error , please advise
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 7 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.