[Asterisk-code-review] func odbc: Use one connection per DSN. (asterisk[13])
Mark Michelson
asteriskteam at digium.com
Fri Apr 22 14:13:35 CDT 2016
Mark Michelson has uploaded a new patch set (#2).
Change subject: func_odbc: Use one connection per DSN.
......................................................................
func_odbc: Use one connection per DSN.
res_odbc was changed in Asterisk 13.8.0 to remove connection management,
opting instead to let unixodbc maintain open connections and return
those to Asterisk as requested.
This was a boon for realtime, since it meant that multiple threads could
potentially run parallel queries since they could each be using their
own database connections.
However, on the user-facing side, func_odbc, there were some inherent
behaviors being relied on that no longer hold true after the change.
One such reported behavior was that MySQL's LAST_INSERTED_ID() works
per-connection. This means that if Asterisk uses separate connections
for every database operation, whereas before it used one connection for
everything, we have broken expectations and functionality.
The fix provided in this patch is to make func_odbc use a single
database connection per DSN. This way, user-facing database usage will
have the same behavior as it did pre-13.8.0. However, realtime, which is
the real workhorse of database interaction, will continue to let
unixodbc manage connections.
ASTERISK-25938 #close
Reported by Edwin Vandamme
Change-Id: Iac961fe79154c6211569afcdfec843c0c24c46dc
---
M funcs/func_odbc.c
1 file changed, 229 insertions(+), 85 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/82/2682/2
--
To view, visit https://gerrit.asterisk.org/2682
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iac961fe79154c6211569afcdfec843c0c24c46dc
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
More information about the asterisk-code-review
mailing list