fixed issue 864, thanks Niphlod

This commit is contained in:
mdipierro committed 2012-07-17 17:11:23 -05:00
1 parent 9d2ed04ed4
commit 14b6cc5650
2 files changed
+5 -7

No files matched your search

+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-07-17 16:15:26) dev Version 2.00.0 (2012-07-17 17:11:20) dev
+4 -6
View File
@@ -1878,17 +1878,15 @@ class SQLiteAdapter(BaseAdapter):
return '(%s REGEXP %s)' % (self.expand(first), return '(%s REGEXP %s)' % (self.expand(first),
self.expand(second,'string')) self.expand(second,'string'))
def _select(self, query, fields, attributes): def select(self, query, fields, attributes):
""" """
Simulate SELECT ... FOR UPDATE with BEGIN IMMEDIATE TRANSACTION. Simulate SELECT ... FOR UPDATE with BEGIN IMMEDIATE TRANSACTION.
Note that the entire database, rather than one record, is locked Note that the entire database, rather than one record, is locked
(it will be locked eventually anyway by the following UPDATE). (it will be locked eventually anyway by the following UPDATE).
""" """
sql = super(SQLiteAdapter, self)._select(query, fields, attributes) if attributes.get('for_update', False) and not 'cache' in attributes:
if attributes.get('for_update', False): self.execute('BEGIN IMMEDIATE TRANSACTION;')
sql = 'BEGIN IMMEDIATE TRANSACTION; ' + sql return super(SQLiteAdapter, self).select(query, fields, attributes)
return sql
class SpatiaLiteAdapter(SQLiteAdapter): class SpatiaLiteAdapter(SQLiteAdapter):