Just trying to update the printing of inventory, but the foundsetUpdater is returning false.
Added databaseManager.saveData(Q); to see if there were were any unsaved records prior. Should not have been but still fails to update the records.
This has worked in the past. Am I running out of memory?
If the foundsetUpdater returns false, I now just set the columns for each record...
- Code: Select all
/** @type {QBSelect<db:/stsservoy/inventory>} */
var q = databaseManager.createSelect('db:/stsservoy/inventory');
q.where.add(q.columns.tenant_uuid.eq(globals.makeUUID(globals.session.tenant_uuid)));
q.where.add(q.columns.inventory_uuid.isin(barcodePrintedArray));
var Q = databaseManager.getFoundSet(q);
if (Q.getSize() > 0){
databaseManager.saveData(Q);
var R = databaseManager.getFoundSetUpdater(Q);
var printDate = new Date();
R.setColumn('print_date',printDate);
R.setColumn('lprint',1);
if (!R.performUpdate()){
var idx = 1;var rec = null;
while (rec = Q.getRecord(idx++)){
rec.print_date = printDate;
rec.lprint = 1;
}
databaseManager.saveData(Q);
}
}
Get this error:
ERROR com.servoy.j2db.util.Debug - Error executing sql: update "TEMP_8_8E28242B-1806-44F5-ACF6-642786B79A76" "TEMP_06-44F5-ACF6-642786B79A76" set bc_printed=?, if_lprint=?
where "TEMP_06-44F5-ACF6-642786B79A76"."_sv_rowid" = ? with params: [1 ,type: java.lang.Integer, 1 ,type: java.lang.Integer, 5 ,type: java.lang.Integer] com.servoy.j2db.util.ServoyException:
Update/insert failed, unexpected nr of records affected: expected 1, actual 0
at com.servoy.j2db.server.dataprocessing.Zv.Za(Zv.java:1106) [j2db_server_2020.9.0.3602.jar:?]
at com.servoy.j2db.server.dataprocessing.Zv.performUpdates(Zv.java:559) [j2db_server_2020.9.0.3602.jar:?]
at jdk.internal.reflect.GeneratedMethodAccessor240.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
at com.servoy.j2db.util.AbstractRemoteInvocationHandler.invokeMethod(AbstractRemoteInvocationHandler.java:77) [servoy_shared_2020.9.0.3602.jar:?]
at com.servoy.j2db.util.ThreadingRemoteInvocationHandler$1.run(ThreadingRemoteInvocationHandler.java:79) [servoy_shared_2020.9.0.3602.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]