[Home]

Summary:ASTERISK-03452: [patch] Sanity check in res_odbc
Reporter:Anthony Minessale (anthm)Labels:
Date Opened:2005-02-07 17:22:29.000-0600Date Closed:2008-01-15 15:25:33.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/Configuration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) res_odbc_rev0.diff
( 1) res_odbc_rev1.diff
Description:This patch makes res_odbc more robust about dealing with dead connections, it adds a new api call obdc_sanity_check(obj) you can call on a odbc obj to make sure it's connected this call is used by defaut when an obj is requested and also again in "odbc show" cli command as a way to make sure all the connections are actually up.



****** ADDITIONAL INFORMATION ******

Disclaimer on file.
anthmct@yahoo.com
Comments:By: Mark Spencer (markster) 2005-02-09 20:39:00.000-0600

If I may make another suggestion, how about only checking for database availability if a select fails, and then automatically attempt to reconnect once, totally transparently to the calling function?

By: Anthony Minessale (anthm) 2005-02-10 04:11:51.000-0600

Then you've got to change all the code that does sql stmts to have logic to try mutiple attempts.

This is already totatlly transparent it tests it whenever you request the handle and has already solved ppls problem in production. it's just "select 1" as a test so it doesn't hurt to do alot.

By: Anthony Minessale (anthm) 2005-02-14 09:48:04.000-0600

slightly more efficient way, check on errs only optionally check on fetch possible but unused so far.

By: Mark Spencer (markster) 2005-02-14 13:37:54.000-0600

Did you mean to attach a new patch?

By: Anthony Minessale (anthm) 2005-02-14 14:19:55.000-0600

yah i wonder where it went. ok here it is..

By: Anthony Minessale (anthm) 2005-02-17 09:57:19.000-0600

All this does is fix a bug it is ready to include.

By: Mark Spencer (markster) 2005-02-17 10:32:53.000-0600

Added to CVS, thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:25:33.000-0600

Repository: asterisk
Revision: 5042

U   trunk/include/asterisk/res_odbc.h
U   trunk/res/res_config_odbc.c
U   trunk/res/res_odbc.c

------------------------------------------------------------------------
r5042 | markster | 2008-01-15 15:25:33 -0600 (Tue, 15 Jan 2008) | 2 lines

Merge anthm's ODBC sanity check fix (bug ASTERISK-3452)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=5042