<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.2.3">
</HEAD>
<BODY>
Hi,<BR>
<BR>
The code for pooling/non-pooling is in the DB API.&nbsp; But the function in the DB API that does this is called from db_do_init(), which in turn is called from the various DB module init() functions.<BR>
<BR>
So the change I have made is mostly in the DB API.&nbsp; However, a new init() function to create a non-pooled connection is needed for each DB module you want to do this from.&nbsp; I only need PostgreSQL, and only have PostgreSQL to test with, so I have only added the new init() function to modules/db_postgresql.&nbsp; It would be trivial to add to the other DB modules if required, but should probably be done by someone who can test it.<BR>
<BR>
Peter<BR>
<BR>
On Fri, 2012-04-20 at 19:08 +0200, Klaus Darilion wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>

On 20.04.2012 17:52, Peter Dunkley wrote:
&gt; Hi,
&gt;
&gt; I am just adding a new db init function (init_nopool) to the generic
&gt; _dbf data-structure now. I will implement the actual init_nopool
&gt; function just for PostgreSQL. We only need this for a small proprietary
&gt; module we have, so I don't expect anyone else to use this right away.

AFAIK the pool handling is in the DB API. Thus, shouldn't pooling vs. 
non-pooling a feature of the DB API?

klaus

&gt; If I have time I will make the BEGIN/COMMIT/ROLLBACK functions API
&gt; functions next week, but I want to get the presence notifier stuff done
&gt; first.
&gt;
&gt; Thanks,
&gt;
&gt; Peter
&gt;
&gt; On Fri, 2012-04-20 at 17:44 +0200, Daniel-Constantin Mierla wrote:
&gt;&gt; Hello,
&gt;&gt;
&gt;&gt; On 4/20/12 5:18 PM, Peter Dunkley wrote:
&gt;&gt;&gt; Hi Daniel,
&gt;&gt;&gt;
&gt;&gt;&gt; How would we do the non-pooling stuff inside the module?
&gt;&gt;
&gt;&gt; it can be via new API field, like 'newinit' -- it is anyhow needed
&gt;&gt; only in one or few places, so the other modules using the DB API will
&gt;&gt; not change, just the db conenctors.
&gt;&gt;
&gt;&gt; My concern is actually about the fact that the user will have to know
&gt;&gt; that a module requires internally new connections for same db url.
&gt;&gt; From my point of view, the user knows that the module has to interact
&gt;&gt; with the database and set a DB URL parameter for that.
&gt;&gt;
&gt;&gt; Jan Janak had also a point about the URL format, the '*' not being
&gt;&gt; really right and safe used as part of schema.
&gt;&gt;
&gt;&gt; Therefore two things here:
&gt;&gt; - do we need to specify from config whether it has to be a new
&gt;&gt; connection or not? If it is mandatory to work properly, then it is not
&gt;&gt; a configuration option
&gt;&gt; - how do distinguish from asking a pooled and non-pooled connection.
&gt;&gt; If we need non-pooled is needed to be specified via a config option,
&gt;&gt; then we should do it according tot he URL format, otherwise, should be
&gt;&gt; something internal, with no change in the existing DB url syntax.
&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; I believe BEGIN/COMMIT/ROLLBACK are standard SQL. I did a quick
&gt;&gt;&gt; search online before making the change and found that they seem to be
&gt;&gt;&gt; documented for PostgreSQL, MySQL SQLlite, and SQL Server. The wrapper
&gt;&gt;&gt; functions first check to see if DB_CAP_RAW_QUERY is set for the
&gt;&gt;&gt; database connection it the functions just return without error if raw
&gt;&gt;&gt; queries are not available. I would have thought it safe to assume
&gt;&gt;&gt; that if raw queries are supported the DB module supports SQL?
&gt;&gt;
&gt;&gt; It might be true right now, but even supporting raw_query, it may not
&gt;&gt; have support for transactions. Raw query support can be implemented
&gt;&gt; also for non-SQL. Relying on another generic API member to assume
&gt;&gt; globally an existing specific feature, looks a bit odd for me.
&gt;&gt;
&gt;&gt; I don't know, right now it just feels that such extensions are more
&gt;&gt; appropriate as API members and implemented inside connectors. It has
&gt;&gt; also the benefit of being able to control better the behavior, if what
&gt;&gt; Klaus pointed is needed, like disabling auto-reconnect.
&gt;&gt;
&gt;&gt; The feature is there, reworking a bit during the testing does not mean
&gt;&gt; new features, so it is not a presure to change everything right now.
&gt;&gt; But we should do the right decision so we don 't need to change in
&gt;&gt; short term.
&gt;&gt;
&gt;&gt; Cheers,
&gt;&gt; Daniel
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; Peter
&gt;&gt;&gt;
&gt;&gt;&gt; On Fri, 2012-04-20 at 17:09 +0200, Daniel-Constantin Mierla wrote:
&gt;&gt;&gt;&gt; Hello,
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; since it came back in the spotlight, I think the non-pooling flag
&gt;&gt;&gt;&gt; should not be exposed to the config. The admin has usually no
&gt;&gt;&gt;&gt; knowledge of modules' internals to know it has to configure with a
&gt;&gt;&gt;&gt; new connection -- it should be only inside the module.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Then, is BEGIN/COMMIT/ROLLBACK a standard everywhere across DB/SQL
&gt;&gt;&gt;&gt; servers? Even if in SQL, the DB api is not only for them. I seems to
&gt;&gt;&gt;&gt; be that these new functions should be better part of DB api and
&gt;&gt;&gt;&gt; implemented inside the db modules. That allows also for temporarily
&gt;&gt;&gt;&gt; disabling of reconnect when needed, Eventually, other DB (non-SQL)
&gt;&gt;&gt;&gt; connectors can have custom implementation.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Cheers,
&gt;&gt;&gt;&gt; Daniel
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; On 4/20/12 4:56 PM, Peter Dunkley wrote:
&gt;&gt;&gt;&gt;&gt; I'll update the RLS documentation to make that clear.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; As for the second item... The non-pooling stuff is still done with
&gt;&gt;&gt;&gt;&gt; a '*' at the start of the DB URL. The DB stuff doesn't use the
&gt;&gt;&gt;&gt;&gt; standard Kamailio URI parser so making DB pooling a proper
&gt;&gt;&gt;&gt;&gt; parameter is not as simple as I'd hoped it'd be. Also, the
&gt;&gt;&gt;&gt;&gt; parameter stuff would be in lib/srdb1 whereas the retries parameter
&gt;&gt;&gt;&gt;&gt; is in the DB modules themselves (modules/db_mysql and
&gt;&gt;&gt;&gt;&gt; modules/db_postgres), so I am not sure disabling automatic
&gt;&gt;&gt;&gt;&gt; reconnect on a per connection basis will be that simple to add.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; I think I'll leave those DB changes to someone a bit more familiar
&gt;&gt;&gt;&gt;&gt; with the modules :-)
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Thanks,
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Peter
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; On Fri, 2012-04-20 at 16:24 +0200, Klaus Darilion wrote:
&gt;&gt;&gt;&gt;&gt;&gt; Now you should mention that auto reconnect must be disabled otherwise
&gt;&gt;&gt;&gt;&gt;&gt; reconnect during transactions will cause inconsistencies.
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; Probably it would be cool if automatically reconnect would be configured
&gt;&gt;&gt;&gt;&gt;&gt; with the db_url (just as the non-pooling parameter)
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; regards
&gt;&gt;&gt;&gt;&gt;&gt; Klaus
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; On 20.04.2012 15:02, Peter Dunkley wrote:
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  Module: sip-router
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  Branch: master
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  Commit: f71bdc3cbdf5acdf243217778e4159f2e6ab341d
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  URL:<A HREF="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f71bdc3cbdf5acdf243217778e4159f2e6ab341d">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f71bdc3cbdf5acdf243217778e4159f2e6ab341d</A>
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  Author: Peter Dunkley&lt;<A HREF="mailto:peter.dunkley@crocodile-rcs.com">peter.dunkley@crocodile-rcs.com</A>  &lt;<A HREF="mailto:peter.dunkley@crocodile-rcs.com">mailto:peter.dunkley@crocodile-rcs.com</A>&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  Committer: Peter Dunkley&lt;<A HREF="mailto:peter.dunkley@crocodile-rcs.com">peter.dunkley@crocodile-rcs.com</A>  &lt;<A HREF="mailto:peter.dunkley@crocodile-rcs.com">mailto:peter.dunkley@crocodile-rcs.com</A>&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  Date:   Fri Apr 20 14:00:22 2012 +0100
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  modules_k/rls: Used db_begin() and db_commit() around blocks of related DB queries and updates
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  - This makes these related sets of DB queries a single transaction.  As Klaus
&gt;&gt;&gt;&gt;&gt;&gt; &gt;     pointed out this if you don't do this you can get inconsistencies when using
&gt;&gt;&gt;&gt;&gt;&gt; &gt;     multiple presence servers.
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  ---
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;    modules_k/rls/notify.c          |   12 ++++++++++++
&gt;&gt;&gt;&gt;&gt;&gt; &gt;    modules_k/rls/resource_notify.c |   24 ++++++++++++++++++++++++
&gt;&gt;&gt;&gt;&gt;&gt; &gt;    modules_k/rls/rls_db.c          |   21 +++++++++++++++++++++
&gt;&gt;&gt;&gt;&gt;&gt; &gt;    3 files changed, 57 insertions(+), 0 deletions(-)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  diff --git a/modules_k/rls/notify.c b/modules_k/rls/notify.c
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  index 082fbfa..1836808 100644
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  --- a/modules_k/rls/notify.c
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +++ b/modules_k/rls/notify.c
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  @@ -128,6 +128,12 @@ int send_full_notify(subs_t* subs, xmlNodePtr rl_node, str* rl_uri,
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                    goto error;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        if (db_begin(&amp;rlpres_dbf, rlpres_db)&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                LM_ERR(&quot;in BEGIN\n&quot;);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                goto error;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            if(rlpres_dbf.query(rlpres_db, query_cols, 0, query_vals, result_cols,
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                                            1, n_result_cols,&amp;str_resource_uri_col,&amp;result )&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  @@ -257,6 +263,12 @@ int send_full_notify(subs_t* subs, xmlNodePtr rl_node, str* rl_uri,
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                    goto error;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        if (db_commit(&amp;rlpres_dbf, rlpres_db)&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                LM_ERR(&quot;in COMMIT\n&quot;);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                goto error;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            xmlFree(rlmi_cont-&gt;s);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            pkg_free(rlmi_cont);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  diff --git a/modules_k/rls/resource_notify.c b/modules_k/rls/resource_notify.c
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  index 29e0b11..87ce806 100644
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  --- a/modules_k/rls/resource_notify.c
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +++ b/modules_k/rls/resource_notify.c
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  @@ -893,6 +893,12 @@ static void timer_send_full_state_notifies(int round)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                    goto done;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        if (db_begin(&amp;rls_dbf, rls_db)&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                LM_ERR(&quot;in BEGIN\n&quot;);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                goto done;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            /* Step 1: Find rls_watchers that require full-state notification */
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            if (rls_dbf.query(rls_db, query_cols, 0, query_vals, result_cols,
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                                    1, n_result_cols, 0,&amp;result)&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  @@ -912,6 +918,12 @@ static void timer_send_full_state_notifies(int round)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                    goto done;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        if (db_commit(&amp;rls_dbf, rls_db)&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                LM_ERR(&quot;in COMMIT\n&quot;);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                goto done;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            /* Step 3: Full-state notify each watcher we found */
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            rows = RES_ROWS(result);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            for (i = 0; i&lt;   RES_ROW_N(result); i++)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  @@ -1025,6 +1037,12 @@ static void timer_send_update_notifies(int round)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                    goto done;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        if (db_begin(&amp;rlpres_dbf, rlpres_db)&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                LM_ERR(&quot;in BEGIN\n&quot;);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                goto error;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            if(rlpres_dbf.query(rlpres_db, query_cols, 0, query_vals, result_cols,
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                                            1, n_result_cols,&amp;str_rlsubs_did_col,&amp;result)&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  @@ -1042,6 +1060,12 @@ static void timer_send_update_notifies(int round)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                    goto error;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        if (db_commit(&amp;rlpres_dbf, rlpres_db)&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                LM_ERR(&quot;in COMMIT\n&quot;);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                goto error;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            send_notifies(result, did_col, resource_uri_col, auth_state_col, reason_col,
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                      pres_state_col, content_type_col);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;    error:
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  diff --git a/modules_k/rls/rls_db.c b/modules_k/rls/rls_db.c
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  index 6a00c21..46bda91 100644
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  --- a/modules_k/rls/rls_db.c
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +++ b/modules_k/rls/rls_db.c
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  @@ -124,6 +124,7 @@ int delete_expired_subs_rlsdb( void )
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            int i;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            subs_t subs;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            str rlsubs_did = {0, 0};
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        int transaction_started = 0;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            if(rls_db == NULL)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  @@ -148,6 +149,13 @@ int delete_expired_subs_rlsdb( void )
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            result_cols[r_to_tag_col=n_result_cols++] =&amp;str_to_tag_col;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            result_cols[r_from_tag_col=n_result_cols++] =&amp;str_from_tag_col;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        if (db_begin(&amp;rls_dbf, rls_db)&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                LM_ERR(&quot;in BEGIN\n&quot;);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                goto error;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        transaction_started = 1;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            if(rls_dbf.query(rls_db, query_cols, query_ops, query_vals, result_cols,
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                                    n_query_cols, n_result_cols, 0,&amp;result )&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  @@ -213,12 +221,25 @@ int delete_expired_subs_rlsdb( void )
&gt;&gt;&gt;&gt;&gt;&gt; &gt;                    pkg_free(rlsubs_did.s);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        if (db_commit(&amp;rls_dbf, rls_db)&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                LM_ERR(&quot;in COMMIT\n&quot;);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                goto error;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            if(result) rls_dbf.free_result(rls_db, result);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            return 1;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;    error:
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            if (result) rls_dbf.free_result(rls_db, result);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            if (rlsubs_did.s) pkg_free(rlsubs_did.s);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        if (transaction_started)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        {
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                if (db_commit(&amp;rls_dbf, rls_db)&lt;   0)
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +                        LM_ERR(&quot;in COMMIT\n&quot;);
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +        }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  +
&gt;&gt;&gt;&gt;&gt;&gt; &gt;            return -1;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;    }
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  _______________________________________________
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  sr-dev mailing list
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  <A HREF="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</A>  &lt;<A HREF="mailto:sr-dev@lists.sip-router.org">mailto:sr-dev@lists.sip-router.org</A>&gt;
&gt;&gt;&gt;&gt;&gt;&gt; &gt;  <A HREF="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</A>
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; --
&gt;&gt;&gt;&gt;&gt; Peter Dunkley
&gt;&gt;&gt;&gt;&gt; Technical Director
&gt;&gt;&gt;&gt;&gt; Crocodile RCS Ltd
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; _______________________________________________
&gt;&gt;&gt;&gt;&gt; sr-dev mailing list
&gt;&gt;&gt;&gt;&gt; <A HREF="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</A>  &lt;<A HREF="mailto:sr-dev@lists.sip-router.org">mailto:sr-dev@lists.sip-router.org</A>&gt;
&gt;&gt;&gt;&gt;&gt; <A HREF="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</A>
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; --
&gt;&gt;&gt;&gt; Daniel-Constantin Mierla
&gt;&gt;&gt;&gt; Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
&gt;&gt;&gt;&gt; <A HREF="http://www.asipto.com/index.php/kamailio-advanced-training/">http://www.asipto.com/index.php/kamailio-advanced-training/</A>
&gt;&gt;&gt;
&gt;&gt;&gt; --
&gt;&gt;&gt; Peter Dunkley
&gt;&gt;&gt; Technical Director
&gt;&gt;&gt; Crocodile RCS Ltd
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt; --
&gt;&gt; Daniel-Constantin Mierla
&gt;&gt; Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
&gt;&gt; <A HREF="http://www.asipto.com/index.php/kamailio-advanced-training/">http://www.asipto.com/index.php/kamailio-advanced-training/</A>
&gt;
&gt; --
&gt; Peter Dunkley
&gt; Technical Director
&gt; Crocodile RCS Ltd
&gt;
</PRE>
</BLOCKQUOTE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>