Hi Dmitry,
you hit a bug in the mysql driver of tntdb. I fixed it in the git repo.
The problem is, that cached statements hold a reference to the
connection and the connection holds a reference to its cached
statements. Hence the connection is never freed. The solution is, that a
statement should not prevent the connection to be freed.
As a workaround you should not use prepareCached when using mysql.
Tommi
Am 22.01.2014 22:11, schrieb Dmitry Dneprov:
Hi Tommi !
Your example works fine without errors !
But if I replace conn.prepare in line
tntdb::Statement ins = conn.prepare(
"insert into foo(a, b) values (:a, :b)");
with conn.prepareCached
then there is no more 'mysql_close' messages in the log,
which leads to connections leak - they are not returned
to the pool and are not freed.
May be this is due to my misunderstanding of conn.prepareCached
usage rules - documentation can be expanded with correct usage scenarios
for this function.
Dima
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general