Tony committed a new method that allows a hybrid mode for the connection pool. &nbsp;This is now used by mod_db (thus db backend for limit) and cidlookup. &nbsp;I&#39;ll convert lcr over to it too.<div><br></div><div>This should help with connection counts for database handle usage that doesn&#39;t need thread affinity.<br>
<br><div class="gmail_quote">2010/6/29 Anthony Minessale <span dir="ltr">&lt;<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
it&#39;s wrong.<div><br></div><div>That patch breaks things horribly I tested it.</div><div>I forgot that the flag is only cleared when the thread who created it, exits.</div><div><br></div><div>The point is to keep the db connection dedicated to that thread until it exits.</div>

<div>if the total connections run out it may be due to mod_limit and postgres only having 100 connections as the default.</div><div><br></div><div><br><br><div class="gmail_quote">2010/6/28 夏青 <span dir="ltr">&lt;<a href="mailto:xiaqing@hundsun.com" target="_blank">xiaqing@hundsun.com</a>&gt;</span><div>
<div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Following is the translation from Chinese:<br>
<br>
We found a problem when testing Freeswitch version 1.0.19, it will create too many ODBC connections, and lead to unable create &nbsp;new connection. It should be caused by following function that flag was not removed.<br>
<div><br>
SWITCH_DECLARE(void)<br>
switch_cache_db_release_db_handle(switch_cache_db_handle_t ** dbh) {<br>
 &nbsp; if(dbh &amp;&amp; *dbh)<br>
 &nbsp; {<br>
</div> &nbsp; &nbsp; &nbsp; &nbsp;switch_clear_flag(*dbh, CDF_INUSE); &nbsp;//remove INUSE flag<br>
<div> &nbsp; &nbsp; &nbsp; &nbsp;switch_mutex_unlock((*dbh)-&gt;mutex);<br>
</div> &nbsp; &nbsp; &nbsp; &nbsp;*dbh = NULL;<br>
<div><div></div><div> &nbsp; }<br>
}<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:freeswitch-dev-bounces@lists.freeswitch.org" target="_blank">freeswitch-dev-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-dev-bounces@lists.freeswitch.org" target="_blank">freeswitch-dev-bounces@lists.freeswitch.org</a>] On Behalf Of Seven Du<br>


Sent: Tuesday, June 29, 2010 7:43 AM<br>
To: <a href="mailto:freeswitch-dev@lists.freeswitch.org" target="_blank">freeswitch-dev@lists.freeswitch.org</a><br>
Subject: Re: [Freeswitch-dev] odbc连接过多的问题<br>
<br>
agree with mrene that the google translation is horrible in this case.<br>
<br>
2010/6/29 Anthony Minessale &lt;<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>&gt;:<br>
&gt; turns out that change is horrible.<br>
&gt; i think his problem is he needs more connections because that change<br>
&gt; really messes things up<br>
&gt;<br>
&gt; 2010/6/28 Mathieu Rene &lt;<a href="mailto:mrene_lists@avgs.ca" target="_blank">mrene_lists@avgs.ca</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; I guess the source was easier to read than the google translation<br>
&gt;&gt; anyways Mathieu Rene Avant-Garde Solutions Inc<br>
&gt;&gt; Office: + 1 (514) 664-1044 x100<br>
&gt;&gt; Cell: +1 (514) 664-1044 x200<br>
&gt;&gt; <a href="mailto:mrene@avgs.ca" target="_blank">mrene@avgs.ca</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 2010-06-28, at 9:50 AM, EdPimentl wrote:<br>
&gt;&gt;<br>
&gt;&gt; This is what he said:<br>
&gt;&gt;<br>
&gt;&gt; In the test FREEESWITCH<br>
&gt;&gt; 1.0.19 version of the time found a problem, too much can cause odbc<br>
&gt;&gt; connection, leading to not create a new connection problem. Find the<br>
&gt;&gt; code found in the following function should be connected without<br>
&gt;&gt; removing the logo.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; SWITCH_DECLARE (void)<br>
&gt;&gt; switch_cache_db_release_db_handle (switch_cache_db_handle_t ** dbh) (<br>
&gt;&gt; if (dbh &amp; &amp; * dbh) ( switch_clear_flag (* dbh, CDF_INUSE); / / get<br>
&gt;&gt; rid of using the state flag switch_mutex_unlock ((* dbh) -&gt; mutex);<br>
&gt;&gt; * Dbh = NULL;<br>
&gt;&gt; )<br>
&gt;&gt; )<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; -E<br>
&gt;&gt; Gpro.ws<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; FreeSWITCH-dev mailing list<br>
&gt;&gt; <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-de" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-de</a><br>
&gt;&gt; v<br>
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; FreeSWITCH-dev mailing list<br>
&gt;&gt; <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-de" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-de</a><br>
&gt;&gt; v<br>
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Anthony Minessale II<br>
&gt;<br>
&gt; FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
&gt; ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
&gt; Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
&gt;<br>
&gt; AIM: anthm<br>
&gt; <a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>
&gt; GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
&gt; IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
&gt;<br>
&gt; FreeSWITCH Developer Conference<br>
&gt; <a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br>
&gt; <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>
&gt; pstn:+19193869900<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; FreeSWITCH-dev mailing list<br>
&gt; <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
Blog: <a href="http://www.dujinfang.com" target="_blank">http://www.dujinfang.com</a><br>
Proj: &nbsp;<a href="http://www.freeswitch.org.cn" target="_blank">http://www.freeswitch.org.cn</a><br>
<br>
_______________________________________________<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
_______________________________________________<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div></div></div><br><br clear="all"><br>-- <br><div class="im">Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>

Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>
GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900<br>
</div></div>
<br>_______________________________________________<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-Rupa<br>
</div>