Skip to content

MySQL session state is not cleared in SessionPool #2546

@Erbengi

Description

@Erbengi

Expected behavior

Session returned by SessionPool::get() isn't affected by it's previous usage (only MySQL).

Actual behavior

Session returned by SessionPool::get() has state from it's previous usage (only MySQL).

Steps to reproduce the problem

It is quite difficult to simulate it. Lets say we have 2 sessions in SessionPool: session1 and session2.

Get session1 by call SessionPool::get() and use it to insert some data to table:

INSERT INTO my_table ("test");

Get session2 from session pool and use it to remove row from table:

DELETE FROM my_table WHERE column="test";

Get session1 from session pool and try to find deleted data:

SELECT column FROM my_table WHERE column="test"

The statement found the row which was deleted with session2

POCO version

1.9.0

Compiler and version

gcc 7.3.0

Operating system and version

Ubuntu 18.04, Ubuntu 16.04

Other relevant information

This issue can be fixed by using mysql_reset_connection() when Session is returned to the SessionPool.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions