[Freeswitch-users] Spidermonkey ODBC

Steven Brown steven.brown at justfone.com
Mon Feb 18 15:34:09 PST 2008


Hi,
 
I'm experimenting with spidermonkey for JavaScript call control, the basics seem fine and I'm now trying to connect to an existing Firebird database, the Firebird odbc lib is installed ok as is unixODBC and I can confirm this and access the db no problem with isql, something strange happens though when I connect in spidermonkey, basically the odbc connection is made successfully, but then as soon as I call either exec or query the odbc connection starts to drop and re-connect continuously, 
 
the isql output is below 
 
isql -v test
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select first 1 * from pool_phones
+---------------------+------------+
| GSMNO               | ORGNO      |
+---------------------+------------+
| 0712345678         | 1          |
+---------------------+------------+
SQLRowCount returns 1
1 rows fetched
SQL>

however the following test code calling the same query
 
use("ODBC");
var db = new ODBC("test","SYSDBA","masterkey");
db.connect();
db.query("select first 1 *  from pool_phones");
db.nextRow();
row = db.getData();
console_log("INFO","HELLO " +  row["GSMNO"]  + "\n");
exit();
 
gives the following output and then just loops disconnecting and reconnecting until I shutdown freeswitch

2008-02-18 23:26:03 [DEBUG] switch_core_state_machine.c:144 switch_core_standard_on_execute() sofia/default/1000 at 192.168.0.7:5060 <mailto:sofia/default/1000 at 192.168.0.7:5060>  Execute javascript(/usr/scripts/test1.js)
2008-02-18 23:26:03 [DEBUG] mod_spidermonkey.c:3150 js_api_use() Loading ODBC
2008-02-18 23:26:03 [DEBUG] switch_odbc.c:145 switch_odbc_handle_connect() Connecting test
2008-02-18 23:26:03 [DEBUG] switch_odbc.c:174 switch_odbc_handle_connect() Connected to [test]
2008-02-18 23:26:03 [DEBUG] switch_odbc.c:95 switch_odbc_handle_disconnect() Disconnected 0 from [test]
2008-02-18 23:26:03 [DEBUG] switch_odbc.c:142 switch_odbc_handle_connect() Re-connecting test
2008-02-18 23:26:03 [DEBUG] switch_odbc.c:145 switch_odbc_handle_connect() Connecting test
2008-02-18 23:26:03 [DEBUG] switch_odbc.c:174 switch_odbc_handle_connect() Connected to [test]
2008-02-18 23:26:03 [CRIT] switch_odbc.c:234 db_is_up() The sql server is not responding for DSN test []
2008-02-18 23:26:03 [INFO] switch_odbc.c:239 db_is_up() The connection has been re-established
...

Any ideas much appreciated

Thanks

Steve

 

 

 

 



 
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080218/af9db13e/attachment-0002.html 


More information about the FreeSWITCH-users mailing list