Skip to content

Reset connection when a session is returned to the SessionPool#2547

Merged
obiltschnig merged 6 commits intopocoproject:poco-1.9.1from
Erbengi:bugfix/mysql_session
Nov 24, 2018
Merged

Reset connection when a session is returned to the SessionPool#2547
obiltschnig merged 6 commits intopocoproject:poco-1.9.1from
Erbengi:bugfix/mysql_session

Conversation

@Erbengi
Copy link
Copy Markdown

@Erbengi Erbengi commented Nov 20, 2018

Fix of issue #2546

Copy link
Copy Markdown
Member

@obiltschnig obiltschnig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resetConnection() should be just reset(), otherwise looks good.

@obiltschnig obiltschnig requested a review from aleks-f November 20, 2018 08:59
resetConnection() -> reset()
@Erbengi
Copy link
Copy Markdown
Author

Erbengi commented Nov 20, 2018

Ok, I've renamed the methods.

@Erbengi
Copy link
Copy Markdown
Author

Erbengi commented Nov 20, 2018

It seems that function mysql_reset_connection() was added in MySQL 5.7, but CI machines use 5.6. Probably mysql_refresh() should be a solution but I need to test it first.

@Erbengi
Copy link
Copy Markdown
Author

Erbengi commented Nov 21, 2018

mysql_refresh() seems working same as mysql_reset_connection()

@obiltschnig
Copy link
Copy Markdown
Member

Ideally, since mysql_refresh() is marked as deprecated, you should check for the MySQL client version and switch between mysql_refresh() and mysql_reset_connection() using the preprocessor.

available

Use mysql_reset_connection() only if MySQL version is >= 5.7 or MariaDB
version is >= 3.0.0 otherwise fall back to myslq_refresh()
@Erbengi
Copy link
Copy Markdown
Author

Erbengi commented Nov 21, 2018

Ok, mysql_reset_connection() is now used if MySQL version is >= 5.7 or MariaDB version is >= 3.0.0 otherwise mysql_refresh() is used.

@obiltschnig obiltschnig merged commit f475069 into pocoproject:poco-1.9.1 Nov 24, 2018
@obiltschnig obiltschnig added this to the Release 1.10.0 milestone Jun 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants