title: PG::TRDeadlockDetected; Process i waits for ShareLock on transaction j;
body: <p>As a team, we run a software as a service, written in Ruby on Rails, for the National Home Watch Association to aid teams in monitoring cottages, homes, cabins, garages, boat houses, spas, pools, driveways and yards in the tenant's absence.</p>
  
  <p>There is an issue logged in Airbrake with 67 occurrences since our last deployment.  This is a transcript of the Airbrake synopsis :</p>
  
  <pre><code>Error class PG::TRDeadlockDetected
  Error message PG::TRDeadlockDetected: ERROR: deadlock detected DETAIL: Process i waits for ShareLock on transaction j; blocked by process k. Process k waits for ShareLock on transaction j; blocked by process i. HINT: See server log for query details.
  Action tenant/tasks#update
  URL https://subdomain.qridithomewatch.com/tasks/{id}
  File [GEM_ROOT]/gems/activerecord-4.0.4/lib/active_record/connection_adapters/postgresql_adapter.rb:791
  </code></pre>
  
  <p>This is the snippet of the tenant/tasks#update action : </p>
  
  <pre><code>def update
      respond_smart_with @resource, {}, (@resource.qrid_id ? edit_tenant_qrid_url(@resource.qrid_id) : tenant_tasks_url(work_type_id: @resource.work_type_id, client_type: @resource.client_type)) if @resource.update(resource_params)    
  end
  </code></pre>
  
  <p>Also, I have included the Respondable Concern (respond_smart_with) just in case as a PasteBin : <a href="http://pastebin.com/pFQuRc4P" rel="noreferrer">http://pastebin.com/pFQuRc4P</a></p>
  
  <p>I appreciate your time and consideration.</p>
  
  <p>Kind regards,
  Jason of Quick Report Systems</p>