当我添加或保存一些关于使用 JayData 和 SQL Lite Provider 的数据时(在电话间隙中)。我收到以下错误:
默认错误:默认错误回调!
异常数据:参数 [1] 0:SQLError 代码:0 消息:“语句回调引发异常或语句错误回调未返回 false” proto:SQLError ......长度:1 proto:对象获取堆栈:函数() { [本机代码] } 消息:“默认错误回调!” 名称:“DefaultError”设置堆栈:函数(){[本机代码]} 原型:对象jaydata.min.js:53 Guard.raise jaydata.min.js:53未捕获的默认错误:默认错误回调!
但是记录添加/更新正常。不知道问题可能是什么......有什么想法吗?
代码是:
//Entities:
var Task = $data.Entity.extend("$org.types.Task", {
Id: { type: "int", key: true },
TaskType: { type: String, required: false },
StatusId: { type: "int", required: false },
DateScheduled: { type: Date, required: false },
TimeSlot: { type: String, required: false },
LastUpdated: { type: Date,required: false },
TaskName: { type: String, required: false },
SpecialInstructions: { type: String},
PropertyAddress: { type: String, required: false },
PropertyPostCode: { type: String, required: false },
PropertyType: { type: String, required: false },
NumberOfBedrooms: { type: "int", required: false },
HasGarage: { type: Boolean, required: false },
HasOutHouse: { type: Boolean, required: false },
IsReadyForReportGeneration: {type: Boolean},
TaskStatus: {type: String},
DateOfTaskDisplayName: {type: String}
});
//inside a look etc:
taskToUpdate.TaskType = task.TaskType;
taskToUpdate.StatusId = task.TaskStatusId;
taskToUpdate.TaskStatus = task.TaskStatus;
taskToUpdate.DateScheduled = task.Date;
taskToUpdate.TimeSlot = task.Time;
taskToUpdate.LastUpdated = new Date();
taskToUpdate.TaskName = "Job " + task.TaskId + " " + task.TaskType + " @" + task.AddressOfTask + ", " + task.PropertyPostCode;
taskToUpdate.SpecialInstructions = specialInstructions;
taskToUpdate.PropertyAddress = task.AddressOfTask;
taskToUpdate.PropertyPostCode = task.PropertyPostCode;
taskToUpdate.PropertyType = task.PropertyType;
taskToUpdate.NumberOfBedrooms = task.NumberOfBedrooms;
taskToUpdate.HasGarage = task.HasGarage;
taskToUpdate.HasOutHouse = task.HasOutHouse;
taskToUpdate.DateOfTaskDisplayName = task.DateOfTaskDisplayName,
taskToUpdate.IsReadyForReportGeneration = task.ReportReady;
if (result.length == 0) {
$org.context.Task.add(taskToUpdate);
}
rowsProcessed++;
if (rowsProcessed == rowsToProcess) {
$org.context.saveChanges({
success: function(db) {
viewModel.messages.push({message:"Tasks saved to local device."});
showNotificationInfo("Tasks saved to local device.");
hideLoader();
}, error: function(err) {
console.log(err);
viewModel.messages.push({message:"Errors saving tasks: " + err});
showNotificationError("Errors saving tasks: " + err);
hideLoader();
}
});
}