I keep getting the following error:
fatal error: 'try!' expression unexpectedly raised an error: disk I/O error (code: 10): file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-800.0.63/src/swift/stdlib/public/core/ErrorType.swift, line 178
when I implement the following code:
try db!.transaction() {
hold = true
for obj in object {
if table.rawValue == DBTableNames.Products.rawValue {
let product : ProductObject = obj as! ProductObject
insert = self.productsTable.insert(
self.productcode <- product.productcode,
self.admincost <- product.admincost,
self.allocatedstock <- product.allocatedstock,
self.availablestock <- product.availablestock,
self.backorderstock <- product.backorderstock,
self.barcode <- product.barcode,
self.binno <- product.binno,
self.casesperlayer <- product.casesperlayer,
self.clearanceprice <- product.clearanceprice,
self.exportprice <- product.exportprice,
self.fulldescription <- product.fulldescription,
self.gqcoded <- product.gqcoded,
self.group <- product.group,
self.innerbarcode <- product.innerbarcode,
self.innerqty <- product.innerqty,
self.lastPoDate <- product.lastPoDate as Date,
self.layersperpallet <- product.layersperpallet,
self.longdescription1 <- product.longdescription1,
self.mtdsales <- product.mtdsales,
self.onorderstock <- product.onorderstock,
self.outerbarcode <- product.outerbarcode,
self.packqty <- product.packqty,
self.palletqty <- product.palletqty,
self.physicalstock <- product.physicalstock,
self.rollingsales <- product.rollingsales,
self.rsp <- product.rsp,
self.shortdescription <- product.shortdescription,
self.threemonth <- product.threemonth,
self.warehouse <- product.warehouse,
self.weight <- product.weight,
self.wholesaleprice <- product.wholesaleprice,
self.ytdsales <- product.wholesaleprice)
}
}
try self.db!.run(insert)
}
I understand its an I/O error but I don't understand what else could be accessing the database blocking the insert
I'm using the following fw:https://github.com/stephencelis/SQLite.swift