python - How to avert "deadlock detected" issue on Postgres + Sqlalchemy? -
here's code on offending lines of code:
webdb.begin(subtransactions=true) (webdb.query(proxy).filter(proxy.service_token == service_token)).update( {proxy.date_deleted_utc: datetime.datetime.utcnow()}, synchronize_session="fetch" ) webdb.commit()
i've tried start subtransaction, , added fetch synchronization.
but still error:
dbapierror: (transactionrollbackerror) deadlock detected detail: process 61086 waits exclusivelock on tuple (7217,55) of relation 626383 of database 380717; blocked process 61094. process 61094 waits sharelock on transaction 55622134; blocked process 61088. process 61088 waits sharelock on transaction 55622141; blocked process 61086. hint: see server log query details. 'update proxies set date_deleted_utc=%(date_deleted_utc)s proxies.service_token = %(service_token_1)s' {'date_deleted_utc': datetime.datetime(2015, 7, 2, 12, 57, 23, 2358), 'service_token_1': u'3733a37e-2094-11e5-90b7-0242ac110080'}
what else can do?
Comments
Post a Comment