Browse Source

[IMP] removing 'FOR UPDATE NOWAIT' as ROW EXCLUSIVE lock is already acquired by DELETE and INSERT

http://www.postgresql.org/docs/9.2/static/explicit-locking.html
pull/22/head
Lorenzo Battistini 10 years ago
parent
commit
3d16bd7fd8
  1. 2
      base_location_geonames_import/wizard/geonames_import.py

2
base_location_geonames_import/wizard/geonames_import.py

@ -86,8 +86,6 @@ class better_zip_geonames_import(models.TransientModel):
% (res_request.status_code, url)) % (res_request.status_code, url))
bzip_ids_to_delete = bzip_obj.search([('country_id', '=', country_id)]) bzip_ids_to_delete = bzip_obj.search([('country_id', '=', country_id)])
if bzip_ids_to_delete: if bzip_ids_to_delete:
self.env.cr.execute('SELECT id FROM res_better_zip WHERE id in %s '
'FOR UPDATE NOWAIT', (tuple(bzip_ids_to_delete), ))
bzip_obj.unlink(bzip_ids_to_delete) bzip_obj.unlink(bzip_ids_to_delete)
logger.info( logger.info(
'%d better zip entries deleted for country %s' '%d better zip entries deleted for country %s'

Loading…
Cancel
Save