<p>We do have this <code>presence</code> module parameters:</p>
<pre><code>modparam("presence", "subs_db_mode", 3)
modparam("presence", "publ_cache", 0)
modparam("presence", "db_table_lock_type", 0)
modparam("presence", "notifier_processes", 3)
modparam("presence", "send_fast_notify", 0)
</code></pre>
<p>And we are getting this errors several times per second</p>
<pre><code>proxy[9056]: ERROR: db_mysql [km_dbase.c:602]: db_mysql_start_transaction(): transaction 
already started
proxy[9056]: ERROR: presence [notify.c:1365]: publ_notify_notifier(): in start_transaction
proxy[9056]: ERROR: presence [presentity.c:1132]: update_presentity(): updating watcher 
records
proxy[9056]: ERROR: presence [publish.c:462]: handle_publish(): when updating presentity
</code></pre>
<p>This logs are from kamailio 4.4.4 but I think the problem is in master too.</p>
<p>I do see that publ_notify_notifier() has a call to start_transaction()<br>
<a href="https://github.com/kamailio/kamailio/blob/master/src/modules/presence/notify.c#L1366-L1373">https://github.com/kamailio/kamailio/blob/master/src/modules/presence/notify.c#L1366-L1373</a><br>
but we are already inside a transaction either at<br>
<a href="https://github.com/kamailio/kamailio/blob/master/src/modules/presence/presentity.c#L686-L693">https://github.com/kamailio/kamailio/blob/master/src/modules/presence/presentity.c#L686-L693</a><br>
or<br>
<a href="https://github.com/kamailio/kamailio/blob/master/src/modules/presence/presentity.c#L735-L742">https://github.com/kamailio/kamailio/blob/master/src/modules/presence/presentity.c#L735-L742</a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/960">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZZMLvwKVyMHCbtbu-x_DN_pO4eh2ks5rX2tYgaJpZM4Ly6LJ">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZWAbX4sbnb3qaLyPZrw7LtGyocIwks5rX2tYgaJpZM4Ly6LJ.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/960"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"presence: error \"transaction  already started\" when updating watcher records on db-only mode (#960)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/960"}}}</script>