Freeswitch DBH - Possible to create connection pool to other DBs?
Been playing with the DBH functionality in LUA. The connection pooling works great if you need to access the core DSN... but if you need to access an external DB, it seems that FS will open a single connection for the maximum number of concurrent calls accessing the LUA script. In * one can limit the connection pool to any DB in res_odbc.conf... but is there a way of doing this in FS? After a learning curve and lots of time, tthis is the one hangup in FS that is preventing me from trashing * altogether. Help me put * in the dustbin for good!
Not sure what you mean here... When a script runs it'll reuse a connection from the pool if there is one. If there isn't it'll open a new one. If you only every have one copy of your script running at a time you'll only get a single connection. But if you get 2 copies running at the same time you'll get 2, 3 copies 3 etc. -Steve On 26 May 2011 02:04, Alan Frisch <frisch.alan@gmail.com> wrote:
Been playing with the DBH functionality in LUA. The connection pooling works great if you need to access the core DSN... but if you need to access an external DB, it seems that FS will open a single connection for the maximum number of concurrent calls accessing the LUA script.
In * one can limit the connection pool to any DB in res_odbc.conf... but is there a way of doing this in FS?
After a learning curve and lots of time, tthis is the one hangup in FS that is preventing me from trashing * altogether. Help me put * in the dustbin for good!
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Steve, Yeah I think the key might be the dbh:release() function. Haven't tested it yet, but rewrote my script so that it releases the DB handles once the call is in progress. Since the CDR/billing is handledby XML CDR no need to keep a handle on the connection. Will have to test it later and see how many connections get spawned. AF. On Thu, May 26, 2011 at 2:25 AM, Steven Ayre <steveayre@gmail.com> wrote:
Not sure what you mean here...
When a script runs it'll reuse a connection from the pool if there is one. If there isn't it'll open a new one.
If you only every have one copy of your script running at a time you'll only get a single connection. But if you get 2 copies running at the same time you'll get 2, 3 copies 3 etc.
-Steve
On 26 May 2011 02:04, Alan Frisch <frisch.alan@gmail.com> wrote:
Been playing with the DBH functionality in LUA. The connection pooling works great if you need to access the core DSN... but if you need to access an external DB, it seems that FS will open a single connection for the maximum number of concurrent calls accessing the LUA script.
In * one can limit the connection pool to any DB in res_odbc.conf... but is there a way of doing this in FS?
After a learning curve and lots of time, tthis is the one hangup in FS that is preventing me from trashing * altogether. Help me put * in the dustbin for good!
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (2)
-
Alan Frisch
-
Steven Ayre