[IMP] base: safer locking at user login
authorMartin Trigaux <mat@openerp.com>
Mon, 22 Sep 2014 15:56:51 +0000 (17:56 +0200)
committerMartin Trigaux <mat@openerp.com>
Mon, 22 Sep 2014 16:18:41 +0000 (18:18 +0200)
commit152c5c2b568044fbd033d2295e8026064243feba
treeb82aac24a4661d9c486d57ef2a023c16de2bc6c0
parent506e397e4a65cfca95f978ac53a63524d13443ba
[IMP] base: safer locking at user login

When a users connects, a lock is taken on the res_user table to modify the last login date. If another running transaction uses a foreign key to res.users (e.g. write_uid column), postgres may detect the update as a concurrent update and rollback the transaction.
In pg 9.3, the lock_strength parameter 'NO KEY' allows a weaker lock which is less likely to break another transaction.
Fixes #552
openerp/addons/base/res/res_users.py