Hello,

I have encountered strange behaviour of tntdb 1.3.
I'm using it with mysql driver on OS X 10.9.
The problem is: after transaction rollback connection is not returned to the 
pool and not freed.

Suspicious code is in poolconnection.cpp, line 76  
(rollbackTransaction method - missing "inTransaction = false;" statement as 
present in commitTransaction method)

  void PoolConnection::commitTransaction()
  {
    connection->commitTransaction();
    inTransaction = false;
  }

  void PoolConnection::rollbackTransaction()
  {
    connection->rollbackTransaction();
    // keep transaction state
  }

After rollback connection is not returned to the pool:

2014-01-22 01:02:09.54181 [12711.140735081100048] DEBUG tntdb.mysql.connection 
- mysql_rollback(0x7fa754000628)
2014-01-22 01:02:09.54200 [12711.140735081100048] DEBUG tntdb.mysql.connection 
- mysql_autocommit(0x7fa754000628, 1)
2014-01-22 01:02:09.54215 [12711.140735081100048] DEBUG tntdb.poolconnection - 
don't reuse connection 0x7fa754000600

After 100 rollbacks I cannot connect to mysql anymore:

2014-01-22 01:05:41.19790 [12711.140735081100048] DEBUG tntdb.connectionpool - 
create new connection for url "mysql:db=workflow;user=dima;password=dima"
2014-01-22 01:05:41.19792 [12711.140735081100048] DEBUG tntdb.connect - 
connect("mysql:db=workflow;user=dima;password=dima")
2014-01-22 01:05:41.19793 [12711.140735081100048] DEBUG tntdb.connect - driver 
"mysql" url="db=workflow;user=dima;password=dima"
2014-01-22 01:05:41.19795 [12711.140735081100048] DEBUG tntdb.mysql.connection 
- Connection::Connection("db=workflow;user=dima;password=dima")
2014-01-22 01:05:41.19798 [12711.140735081100048] DEBUG tntdb.mysql.connection 
- mysql_real_connect(MYSQL, null, null, "dima", "dima", "workflow", 3306, null, 
0)
2014-01-22 01:05:41.19847 [12711.140735081100048] ERROR services.workflow.model 
- Find next task failed: Mysql-Error 1040 in mysql_real_connect: Too many 
connections

------------------------------------------------------------------------------
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

Reply via email to