<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">This check would have to be specific to each odbc connection, not global to the switch, as you could be using different types of databases for different connections. &nbsp;I still lean towards a better way of auto-detecting (probably in addition to a configurable option) if it is at all possible.<div><br></div><div><div><br class="webkit-block-placeholder"></div><div>Mike</div><div><br><div><div>On Feb 20, 2008, at 9:57 AM, Jonas Gauffin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Ok. I've done a patch and will upload it if the following config is ok by Anthony.<br><br>(Either create odbc.conf.xml in autoload_configs or add it directly to freeswitch.xml)<br><br>&nbsp; &lt;section name="odbc" description="odbc general options"&gt;<br> &nbsp;&nbsp;&nbsp; &lt;connection_check&gt;SELECT 1&lt;/connection_check&gt;<br>&nbsp; &lt;/section&gt;<br><br>My patch will load that string when a new connection is created.<br><br><div class="gmail_quote">On Wed, Feb 20, 2008 at 3:40 PM,  &lt;<a href="mailto:freeswitch@dalethatcher.com">freeswitch@dalethatcher.com</a>&gt; wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Could I suggest the 'db check' query be configurable? &nbsp;Oracle is another<br> database which doesn't work with the 'select 1' and needs 'select 1 from<br> dual'. &nbsp;Then you can have the default as 'select 1' and let the end user<br> fiddle with the config for their own particular broken DB.<br> <br> Adding in special code to handle every database out there is going to be<br> a big headache for you. &nbsp;If it isn't already.<br> <br> thanks,<br> <br> - Dale<br> <div><div></div><div class="Wj3C7c"><br> On Wed, Feb 20, 2008 at 06:08:08AM -0800, Anthony Minessale wrote:<br> &gt; Many databases break silently or the connection drops<br> &gt; without any way to know for sure w/o trying to use it.<br> &gt;<br> &gt; I choose to ensure in the core that the data is connected.<br> &gt; executing "select 1" is a small price to pay to make sure<br> &gt; that the database is connected considering the importance<br> &gt; of persistent connectivity in the sip, jingle and call<br> &gt; limit databases as well as the javascript that rely on it.<br> &gt;<br> &gt; All of those applications to make the safe<br> &gt; assumption that the core will keep the db connected and<br> &gt; to change that would be drastic behavior change and<br> &gt; destabilize the code on the eve of our release.<br> &gt;<br> &gt; Therefore i guess we should focus on better heuristics<br> &gt; to detect firebird, preferably based on the driver name<br> &gt; and not by doing a 2nd sql stmt every time.<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;<br> &gt; AIM: anthm<br> &gt; <a href="mailto:MSN:anthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br> &gt; GTALK/JABBER/PAYPAL:<a href="mailto:anthony.minessale@gmail.com">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:888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br> &gt; <a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br> &gt; <a href="mailto:googletalk:conf+888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br> &gt; pstn:213-799-1400<br> &gt;<br> &gt;<br> &gt; ----- Original Message ----<br> &gt; From: David Revill &lt;<a href="mailto:davidrevill@datarun.co.uk">davidrevill@datarun.co.uk</a>&gt;<br> &gt; To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br> &gt; Sent: Tuesday, February 19, 2008 4:37:28 PM<br> &gt; Subject: Re: [Freeswitch-users] Spidermonkey ODBC<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> </div></div>&gt; DIV {<br> &gt; MARGIN:0px;}<br> <div><div></div><div class="Wj3C7c">&gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; Unfortunately, there isn't a universal ansi sql<br> &gt; stmt that will do it as the only statements which can be guaranteed to follow<br> &gt; the ansi standard are the simple select, update and delete statements which rely<br> &gt; on knowing some table name .<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; I think we are trying to solve a problem which need<br> &gt; not exist. The Javascript application should handle the idle timeout. It<br> &gt; should close the connection if it will not be using it for a while,<br> &gt; and,if it needs to, can do what db_is_up is attempting to do in the<br> &gt; application code. Testing for connection before every query seems an<br> &gt; unneccessary overhead.<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; ----- Original Message -----<br> &gt;<br> &gt; &nbsp; From:<br> &gt; &nbsp; Anthony<br> &gt; &nbsp; Minessale<br> &gt;<br> &gt; &nbsp; To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt; &nbsp; Sent: Tuesday, February 19, 2008 6:38<br> &gt; &nbsp; PM<br> &gt;<br> &gt; &nbsp; Subject: Re: [Freeswitch-users]<br> &gt; &nbsp; Spidermonkey ODBC<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; is<br> &gt; &nbsp; there some universal ansi sql stmt that is small and harmless<br> &gt; but is<br> &gt; &nbsp; supported by everything? to replace "select 1"<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; 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;<br> &gt; AIM:<br> &gt; &nbsp; anthm<br> &gt; <a href="mailto:MSN:anthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br> &gt; GTALK/JABBER/PAYPAL:<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a><br> &gt; IRC:<br> &gt; &nbsp; <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br> &gt;<br> &gt;<br> &gt; FreeSWITCH Developer<br> &gt; &nbsp; Conference<br> &gt; <a href="mailto:sip:888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br> &gt; <a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br> &gt; <a href="mailto:googletalk:conf+888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br> &gt; pstn:213-799-1400<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; -----<br> &gt; &nbsp; Original Message ----<br> &gt; From: David Revill<br> &gt; &nbsp; &lt;<a href="mailto:davidrevill@datarun.co.uk">davidrevill@datarun.co.uk</a>&gt;<br> &gt; To:<br> &gt; &nbsp; <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br> &gt; Sent: Tuesday, February 19, 2008<br> &gt; &nbsp; 6:56:31 AM<br> &gt; Subject: Re: [Freeswitch-users] Spidermonkey ODBC<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; One way to detect firebird would be to put the<br> &gt; &nbsp; 'Select first 1 &nbsp;* from RDB$relations' into switch_odbc_handle_connect.<br> &gt; &nbsp; If it succeeds then it is Firebird. A better query might be 'select * from<br> &gt; &nbsp; rdb$database' as the system table rdb$database only ever has 1<br> &gt; &nbsp; record.<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; -----<br> &gt; &nbsp; &nbsp; Original Message -----<br> &gt;<br> &gt; &nbsp; &nbsp; From:<br> &gt; &nbsp; &nbsp; Jonas<br> &gt; &nbsp; &nbsp; Gauffin<br> &gt;<br> &gt; &nbsp; &nbsp; To:<br> &gt; &nbsp; &nbsp; <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; Sent:<br> &gt; &nbsp; &nbsp; Tuesday, February 19, 2008 12:18 PM<br> &gt;<br> &gt; &nbsp; &nbsp; Subject:<br> &gt; &nbsp; &nbsp; Re: [Freeswitch-users] Spidermonkey ODBC<br> &gt;<br> &gt;<br> &gt;<br> &gt; I''ve only tested it with firebird on windows. As you said,<br> &gt; &nbsp; &nbsp; your driver name doesnt match any of the names I used to detect if it's<br> &gt; &nbsp; &nbsp; firebird.<br> &gt;<br> &gt; The problem is that most databases supports "SELECT 1" as a<br> &gt; &nbsp; &nbsp; query. It will always be successful if the the connection is up. However,<br> &gt; &nbsp; &nbsp; firebird did not support "SELECT 1" and therefore i did query the system<br> &gt; &nbsp; &nbsp; database instead.<br> &gt;<br> &gt; If the firebird check fails, it will try to invoke<br> &gt; &nbsp; &nbsp; "SELECT 1", and on firebird that query will fail. And the failure is<br> &gt; &nbsp; &nbsp; interpreted as the connection is down, and therefore it tries to<br> &gt; &nbsp; &nbsp; reconnect.<br> &gt;<br> &gt; That's probably why you get that error. If you have any<br> &gt; &nbsp; &nbsp; other idea on how I can detect if it's a firebird db, please let me know and<br> &gt; &nbsp; &nbsp; i'll fix the odbc code.<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; On Feb 19, 2008 1:05 PM, David Revill &lt;<a href="mailto:davidrevill@datarun.co.uk">davidrevill@datarun.co.uk</a>&gt;<br> &gt; &nbsp; &nbsp; wrote:<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; That's a fair point, but db_is_up is only<br> &gt; &nbsp; &nbsp; &nbsp; called in 2 places and the attempted re-connect could be done if the<br> &gt; &nbsp; &nbsp; &nbsp; exec'd query fails. That way it would not be dependant on the name of the<br> &gt; &nbsp; &nbsp; &nbsp; driver.<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; In my application, the database was queried<br> &gt; &nbsp; &nbsp; &nbsp; at the beginning of the script and the connection closed. It was<br> &gt; &nbsp; &nbsp; &nbsp; explicitly re-connected at the end to post data, so the connection timeout<br> &gt; &nbsp; &nbsp; &nbsp; was not an issue.<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; -----<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Original Message -----<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; From:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Jonas Gauffin<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; To:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Sent:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Tuesday, February 19, 2008 10:35 AM<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Subject:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Re: [Freeswitch-users] Spidermonkey ODBC<br> &gt;<br> &gt;<br> &gt;<br> &gt; I did that code a couple of months ago.<br> &gt; The function<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; was added since connections are closed if they are idle too long, and<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; they were not reconnected again if that happened.<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; On Feb 19, 2008 11:22 AM, David Revill &lt;<a href="mailto:davidrevill@datarun.co.uk">davidrevill@datarun.co.uk</a>&gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; wrote:<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The problem is in switch_odbc.c function<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db_is_up. It assumes that the variable is_firebird is true, but the<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setting of this variable assumes that the Firebird driver name has<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'FIREBIRD', 'FB64' or 'FB32' in it.<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I commented out &nbsp;the code in<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db_is_up and just returned a true value, as on closer inspection<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; could not see the point of this function.<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; David Revill<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -----<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Original Message -----<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; From:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; David Revill<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; To:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sent:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tuesday, February 19, 2008 8:58 AM<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Subject:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Re: [Freeswitch-users] Spidermonkey ODBC<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I spotted this error a few months ago,<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and to my shame did not let everyone know. &nbsp;I have since<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; archived the project so cannot point you to the actual code.<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; However, the problem is &nbsp;that it assumes the name of the<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Firebird Driver (FB64?) &nbsp;to set a boolean, so that it handle<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the connection test differently.<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; When looking at the actual code, I<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; actually felt that the connection test was redundant, as all it did<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; was a select from a system table. This meant it was doing two<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; queries for everyone required. (One to see if it could do a query,<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and then one to do it). I therefore commented the connection test<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function out.<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; regards<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; David Revill<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -----<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Original Message -----<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; From:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Steven Brown<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; To:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sent:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Monday, February 18, 2008 11:34 PM<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Subject:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [Freeswitch-users] Spidermonkey ODBC<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hi,<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I'm experimenting with<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; spidermonkey for JavaScript call control, the basics seem<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fine and I'm now trying to connect to an existing Firebird<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; database, the Firebird odbc lib is installed ok as is unixODBC and<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I can confirm this and access the db no problem with isql,<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; something strange happens though when I connect in spidermonkey,<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; basically the odbc connection is made successfully, but then as<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; soon as I call either exec or query the odbc connection starts to<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drop and re-connect continuously,<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the isql output is below<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; isql -v<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; test<br> &gt; +---------------------------------------+<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Connected!<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sql-statement<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; | help<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [tablename]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; quit<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; +---------------------------------------+<br> &gt; SQL&gt; select<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; first 1 * from<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pool_phones<br> &gt; +---------------------+------------+<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GSMNO<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | ORGNO<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; +---------------------+------------+<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0712345678 &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; +---------------------+------------+<br> &gt; SQLRowCount returns<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1<br> &gt; 1 rows fetched<br> &gt; SQL&gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; however the following test code<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; calling the same query<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; use("ODBC");<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var db = new<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ODBC("test","SYSDBA","masterkey");<br> &gt; db.connect();<br> &gt; db.query("select<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; first 1 * &nbsp;from pool_phones");<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.nextRow();<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row =<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.getData();<br> &gt; console_log("INFO","HELLO " + &nbsp;row["GSMNO"]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ "\n");<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit();<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gives the following output and then<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; just loops disconnecting and reconnecting until I shutdown<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; freeswitch<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2008-02-18 23:26:03 [DEBUG]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch_core_state_machine.c:144 switch_core_standard_on_execute()<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:sofia/default/1000@192.168.0.7">sofia/default/1000@192.168.0.7</a>:5060 Execute<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; javascript(/usr/scripts/test1.js)<br> &gt; 2008-02-18 23:26:03 [DEBUG]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mod_spidermonkey.c:3150 js_api_use() Loading ODBC<br> &gt; 2008-02-18<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23:26:03 [DEBUG] switch_odbc.c:145 switch_odbc_handle_connect()<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Connecting test<br> &gt; 2008-02-18 23:26:03 [DEBUG] switch_odbc.c:174<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch_odbc_handle_connect() Connected to [test]<br> &gt; 2008-02-18<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23:26:03 [DEBUG] switch_odbc.c:95 switch_odbc_handle_disconnect()<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Disconnected 0 from [test]<br> &gt; 2008-02-18 23:26:03 [DEBUG]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch_odbc.c:142 switch_odbc_handle_connect() Re-connecting<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; test<br> &gt; 2008-02-18 23:26:03 [DEBUG] switch_odbc.c:145<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch_odbc_handle_connect() Connecting test<br> &gt; 2008-02-18<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23:26:03 [DEBUG] switch_odbc.c:174 switch_odbc_handle_connect()<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Connected to [test]<br> &gt; 2008-02-18 23:26:03 [CRIT]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch_odbc.c:234 db_is_up() The sql server is not responding for<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DSN test []<br> &gt; 2008-02-18 23:26:03 [INFO] switch_odbc.c:239<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db_is_up() The connection has been re-established<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Any ideas much appreciated<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Thanks<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Steve<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; &nbsp; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt; -----Inline Attachment<br> &gt; &nbsp; Follows-----<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try<br> &gt; &nbsp; it now.<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; mailing<br> &gt; &nbsp; list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt; -----Inline Attachment Follows-----<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; mailing<br> &gt; list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; ____________________________________________________________________________________<br> &gt; Looking for last minute shopping deals?<br> </div></div>&gt; Find them fast with Yahoo! Search. &nbsp;<a href="http://tools.search.yahoo.com/newsearch/category.php?category=shopping" target="_blank">http://tools.search.yahoo.com/newsearch/category.php?category=shopping</a><br> <div><div></div><div class="Wj3C7c">&gt; _______________________________________________<br> &gt; Freeswitch-users mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> <br> <br> _______________________________________________<br> Freeswitch-users mailing list<br> <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> </div></div></blockquote></div><br> _______________________________________________<br>Freeswitch-users mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>http://www.freeswitch.org<br></blockquote></div><br></div></div></body></html>