<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    the first change is not good because results in database connection
    sharing across many processes and could end up on out of sync
    queries at high volume of traffic.<br>
    <br>
    The second one is recommended and is good for safety, so it can be
    added anyhow. On the other hand, the connection can be opened from
    the child_init() invoked for your new process -- I wrote in previous
    email some more details about.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 04/09/14 00:38, Luis Azedo wrote:<br>
    </div>
    <blockquote
cite="mid:CAEvFzR9etm6j19CKt77RAbpXidxssboy4E9hBgseb2CcCAKF9Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Daniel,
        <div><br>
        </div>
        <div>the issue that i'm having with
          calling pres_refresh_watchers (invalid connection when it
          calls get_p_notify_body) from a forked process from my module
          disappears if i comment the lines 411 e 412 in presence.c</div>
        <div>
          <div><span class="" style="white-space:pre"><br>
            </span></div>
          <div><span class="" style="white-space:pre">411 // </span>pa_dbf.close(pa_db);</div>
          <div><span class="" style="white-space:pre">412 // </span>pa_db
            = NULL;</div>
        </div>
        <div><br>
        </div>
        <div>i can achieve the desired result if i leave these lines
          intact and add these lines to pres_refresh_watchers</div>
        <div><br>
        </div>
        <div>
          <div><span class="" style="white-space:pre"> </span>if(pa_db
            == NULL && library_mode == 0) {</div>
          <div><span class="" style="white-space:pre"> </span>pa_db =
            pa_dbf.init(&db_url);</div>
          <div><span class="" style="white-space:pre"> </span>}</div>
        </div>
        <div><br>
        </div>
        <div>the first change is more global and will keep me from
          adding the same lines in (2) to other functions like
          update_watchers_status.</div>
        <div><br>
        </div>
        <div>i would like to see either of these changes merged in
          master and ready for 4.2.</div>
        <div>with these changes and the db_text that i submitted
          earlier, i can then ask to merge the main module db_kazoo into
          master.</div>
        <div><br>
        </div>
        <div>Best</div>
        <div><br>
        </div>
        <div> </div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Next Kamailio Advanced Trainings 2014 - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Sep 22-25, Berlin, Germany</pre>
  </body>
</html>