Problem
I have a program that uses storm 0.14 and this gives me this error in windows:
sqlite3.OperationError: database table is locked
The fact is that in linux it works correctly.
I got the impression that this happens only after a certain number of changes are made, as it happens in some code that copies a lot of objects.
Enabling debug mode gives me this in windows:
83 EXECUTE: 'UPDATE regularorder_product SET discount =? WHERE regularorder_product.order_id =? AND regularorder_product.product_id =? ', (Decimal ("25.00"), 788, 274)
84 DONE
85 EXECUTE: 'UPDATE repeated_orders SET nextDate =? WHERE repeated_orders.id =? ', (Datetime.date (2009, 3, 31), 189)
86 ERROR: database table is locked
In linux:
83 EXECUTE: 'UPDATE regularorder_product SET discount =? WHERE regularorder_product.order_id =? AND regularorder_product.product_id =? ', (Decimal ("25.00"), 789, 274)
84 DONE
85 EXECUTE: 'UPDATE repeated_orders SET nextDate =? WHERE repeated_orders.id =? ', (Datetime.date (2009, 3, 31), 189)
86 DONE
System Information
Window
- Windows XP SP 3
- Python 2.5.4
- NTFS partition
Linux
- Ubuntu 8.10
- Python 2.5.2
- ext3 partition
Some code
def createRegularOrderCopy(self):
newOrder = RegularOrder()
newOrder.date = self.nextDate
for product in self.products:
newOrder.customer = self.customer
newOrder.products.add(product)
return newOrder
orders = getRepeatedOrders(date)
week = timedelta(days=7)
for order in orders:
newOrder = order.createRegularOrderCopy()
store.add(newOrder)
order.nextDate = date + week
Question
Is there anything about sqlite3 / python that is different between windows and linux? What could be the cause of this error and how to fix it?
Another observation
When added COMMITto the place where the error occurs, this error occurs instead:sqlite3.OperationalError: cannot commit transaction - SQL statements in progress
Answers to answers
/, concurrency , Store.