<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    I found the issue.<br>
    Hopefully someone who's maintaining the kamailio db_postgres module
    can react to this.<br>
    <br>
    According to the libpq documentation (see
    <a class="moz-txt-link-freetext" href="http://www.enterprisedb.com/documentation/libpq-concepts.html">http://www.enterprisedb.com/documentation/libpq-concepts.html</a> all
    the way at the bottom).<br>
    <br>
    <blockquote type="cite">One thread restriction is that no two
      threads attempt to manipulate the same
      <tt class="STRUCTNAME">PGconn</tt> object at the same time. In
      particular, you cannot
      issue concurrent commands from different threads through the same
      connection object. (If you need to run concurrent commands, use
      multiple connections.)<br>
    </blockquote>
    I've been adding several debugging code to the db_postgres module,
    And I see that two different threads use two different _con
    variables,<br>
    but the _con-&gt;tail from separate threads are pointing both to
    same memory location, and using the same postgresql connection.<br>
    When multiple threads run at the same time and placing queries
    almost at the same time, it happens that the results of those
    queries are returned back to the other thread.<br>
    <br>
    I don't know the kamailio code (Just started with kamailio 3 weeks
    back),<br>
    but it appears to me that the lib/srdb source is holding using some
    kind of pools for the database connections,<br>
    and db_postgres modules also is using pools.<br>
    <br>
    I'm going to try to see if I can fix the code somehow that every
    thread gets its own database connection.<br>
    but if someone who knows the db_postgres module could help I would
    be very thankfull!<br>
    <br>
    <blockquote cite="mid:4CBD6C3E.7@exa-omicron.nl" type="cite"> <br>
      <div class="moz-signature">-- <br>
        <b>Exa-Omicron</b><br>
        Patroonsweg 10<br>
        3892 DB Zeewolde<br>
        Tel.: 088-OMICRON (66 427 66)<br>
        <a moz-do-not-send="true" class="moz-txt-link-freetext"
          href="http://www.exa-omicron.nl">http://www.exa-omicron.nl</a></div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>
    <br>
    <div class="moz-signature">-- <br>
      <b>Exa-Omicron</b><br>
      Patroonsweg 10<br>
      3892 DB Zeewolde<br>
      Tel.: 088-OMICRON (66 427 66)<br>
      <a class="moz-txt-link-freetext" href="http://www.exa-omicron.nl">http://www.exa-omicron.nl</a></div>
  </body>
</html>