Hi,

 

I want to reuse database connection (mysql) in one of my javascript which is executed on each call. Following is how I am creating ODBC connection.

 

Line1) var db = new ODBC(DSN, DB_USER, DB_PASS);

Line2) db.connect();

 

My first question is, where does it create a database connection on line1 or on line2?

 

Secondly, how can I reuse this connection? so that it is not created for each call and I just use a previously created <code>db</code> object in my routing script.

 

My Objective is:

 

1)      Create ODBC connection on freeswitch startup (could be a database connection pool)

2)      Reuse the connection on each call

3)      Close database connection on freeswitch shutdown (or on some other event)

 

Any help would be highly appreciated.

 

Shoaib