[asterisk-dev] res/res_odbc.c

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Mon Nov 5 06:43:32 CST 2007


On Monday 05 November 2007 03:49:16 Nick Gorham wrote:
> If a "odbc show" is issued against a ODBC driver that only supports a
> single active statement, the test query (or default select 1) can hit
> the existing active statement, cauing it all to go horribly wrong.
>
> The simple solution (It seems to me) is to use the ODBC
> SQLGetConnectAttr( SQL_CONNECTION_DEAD ) methode of checking the status
> of the driver. This seems to work fine against SQLServer using our
> (Easysoft's) driver, but it may need checking how well it works against
> other drivers.
>
> I have made the changes against the current (02/11/07) 1.4 trunk and I
> can send the output from "svn diff" if that helps.

The right place for this is actually the issue tracker:
http://bugs.digium.com, but since you're already here, I need to ask the
obvious question of:  are you using "pooling=yes" in res_odbc.conf?  That
option should prevent this issue from occurring.

In terms of the ODBC option, we'll look into it, but I doubt it's as effective
as running the generic query.  There are some databases (notably MySQL)
where doing the database ping simply doesn't work.

-- 
Tilghman



More information about the asterisk-dev mailing list