[asterisk-users] Asterisk Database Handling

Sherwood McGowan sherwood.mcgowan at gmail.com
Wed May 21 20:26:00 CDT 2008


Steve Prior wrote:
> Tilghman Lesher wrote:
>   
>> Correct; it's actually a workaround for a bug in the MySQL drivers.  It was
>> discovered long after 1.2 was end-of-lifed.
>>
>>     
>
> I got bit by MySQL reconnects on some other software I wrote I think when I 
> jumped from MySQL 4.* to 5.*.  If memory serves, here is the relevant info from 
> the official MySQL documentation:
>
> From: http://dev.mysql.com/doc/refman/5.0/en/upgrading-from-4-1.html
>
> The reconnect flag in the MYSQL structure is set to 0 by mysql_real_connect(). 
> Only those client programs which did not explicitly set this flag to 0 or 1 
> after mysql_real_connect()  experience a change. Having automatic reconnection 
> enabled by default was considered too dangerous (due to the fact that table 
> locks, temporary tables, user variables, and session variables are lost after 
> reconnection).
>
>
> This may explain why this is happening in Asterisk.  In the case of my other 
> code the answer was not to keep a long term connection through idle periods.
>
> Steve
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>   
That's probably why I've never had timeout issues, I use 
asterisk-addons-1.4 when I do use cdr_mysql and I think at one point 
there WAS a problem, but there was a published fix from the 
mysql_connect vs mysql_real_connect issue



More information about the asterisk-users mailing list