Hi,
because I get no responses, I think this is really a bug, so I submitted it as bug #6431.


Marco

Marco Ciancimino wrote:

Hi all,
I have a problem with mmbase connection pooling. I'm using mysql with innodb and transaction support, but that problem should be independent from the database used. Now, consider this sequence of operations:


1) the connection c is acquired from the pool.
2) the autocommit of c is set to false.
3) an update is performed.
4) the connection is returned to the pool without setting autocommit back to true. Hence, there is still an open transaction associated with this connection (DatabaseStorageManager has exactly this kind of behaviour when the beginTransaction is called).


5) other updates are performed with another connection taken from the pool.

Now, suppose that someone else, for example the BasicQueryHandler, wants to make a query and get the connection c from the pool:

6) the connection c is acquired from the pool.
7) the query is performed, but the result is out of date, because the open transaction still associated with the connection c is isolated!


I think this is a bug. I added a setAutocommit(true) in MultiConnection.close() and that solves the problem.

Regards,
Marco











Reply via email to