<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16609" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I spotted this error a few months ago, and to my
shame did not let everyone know. I have since archived the project so
cannot point you to the actual code. However, the problem is that it
assumes the name of the Firebird Driver (FB64?) to set a boolean, so that
it handle the connection test differently.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>When looking at the actual code, I actually felt
that the connection test was redundant, as all it did was a select from a system
table. This meant it was doing two queries for everyone required. (One to see if
it could do a query, and then one to do it). I therefore commented the
connection test function out.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>regards</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>David Revill</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=steven.brown@justfone.com
href="mailto:steven.brown@justfone.com">Steven Brown</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=freeswitch-users@lists.freeswitch.org
href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, February 18, 2008 11:34
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Freeswitch-users] Spidermonkey
ODBC</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial color=#000000 size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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,
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>the isql output is below </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>isql -v
test<BR>+---------------------------------------+<BR>|
Connected!
|<BR>|
|<BR>|
sql-statement
|<BR>| help
[tablename]
|<BR>|
quit
|<BR>|
|<BR>+---------------------------------------+<BR>SQL> select first 1 *
from pool_phones<BR>+---------------------+------------+<BR>|
GSMNO
| ORGNO
|<BR>+---------------------+------------+<BR>|
0712345678 |
1
|<BR>+---------------------+------------+<BR>SQLRowCount returns 1<BR>1 rows
fetched<BR>SQL><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>however the following test code calling the same
query</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>use("ODBC");</FONT></DIV>
<DIV><FONT face=Arial size=2>var db = new
ODBC("test","SYSDBA","masterkey");<BR>db.connect();<BR>db.query("select first
1 * from pool_phones");</FONT></DIV>
<DIV><FONT face=Arial size=2>db.nextRow();</FONT></DIV>
<DIV><FONT face=Arial size=2>row = db.getData();<BR>console_log("INFO","HELLO
" + row["GSMNO"] + "\n");</FONT></DIV>
<DIV><FONT face=Arial size=2>exit();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>gives the following output and then just loops
disconnecting and reconnecting until I shutdown freeswitch<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>2008-02-18 23:26:03 [DEBUG]
switch_core_state_machine.c:144 switch_core_standard_on_execute() </FONT><A
href="mailto:sofia/default/1000@192.168.0.7:5060"><FONT face=Arial
size=2>sofia/default/1000@192.168.0.7:5060</FONT></A><FONT face=Arial size=2>
Execute javascript(/usr/scripts/test1.js)<BR>2008-02-18 23:26:03 [DEBUG]
mod_spidermonkey.c:3150 js_api_use() Loading ODBC<BR>2008-02-18 23:26:03
[DEBUG] switch_odbc.c:145 switch_odbc_handle_connect() Connecting
test<BR>2008-02-18 23:26:03 [DEBUG] switch_odbc.c:174
switch_odbc_handle_connect() Connected to [test]<BR>2008-02-18 23:26:03
[DEBUG] switch_odbc.c:95 switch_odbc_handle_disconnect() Disconnected 0 from
[test]<BR>2008-02-18 23:26:03 [DEBUG] switch_odbc.c:142
switch_odbc_handle_connect() Re-connecting test<BR>2008-02-18 23:26:03 [DEBUG]
switch_odbc.c:145 switch_odbc_handle_connect() Connecting test<BR>2008-02-18
23:26:03 [DEBUG] switch_odbc.c:174 switch_odbc_handle_connect() Connected to
[test]<BR>2008-02-18 23:26:03 [CRIT] switch_odbc.c:234 db_is_up() The sql
server is not responding for DSN test []<BR>2008-02-18 23:26:03 [INFO]
switch_odbc.c:239 db_is_up() The connection has been
re-established</FONT></DIV>
<DIV><FONT face=Arial size=2>...</FONT></DIV>
<P><FONT face=Arial size=2>Any ideas much appreciated</FONT></P>
<P><FONT face=Arial size=2>Thanks</FONT></P>
<P><FONT face=Arial size=2>Steve</FONT></P>
<P><FONT face=Arial size=2></FONT> </P>
<P><FONT face=Arial size=2></FONT> </P>
<P><FONT face=Arial size=2></FONT> </P>
<P><FONT face=Arial size=2> </P>
<DIV><BR><BR></DIV></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Freeswitch-users
mailing
list<BR>Freeswitch-users@lists.freeswitch.org<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></BODY></HTML>