Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dbclient threading issues when DML operations are executed multiple times in a tight loop #3860

Conversation

klustria
Copy link
Member

@klustria klustria commented Feb 2, 2022

Goals of the change:

  1. Backport to 2.4.2.
  2. Make ConnectionPool.connection() run on the same thread as the execution of the DML statement to avoid threadPool and connectionPool exhaustion to fix an issue reported in Running dbClient insert in for loop yields threading issues Running dbClient insert in for loop yields threading issues #2484.
  3. Add unit test that runs each of the DML operations (insert, update, delete) with and without transaction, in a tight loop of 100 iterations while mocking connectionPool to attempt to reproduce the problem.

…le times in a tight loop (helidon-io#3849)

* Fix dbclient threading issues when DML operations (insert, update, delete) are executed multiple times in a tight loop.

* Update unit test to use Mockito to mock Connection and PreparedStatement
@klustria klustria merged commit 68b8d1c into helidon-io:helidon-2.x Feb 3, 2022
@klustria klustria changed the title Fix dbclient threading issues when DML operations are executed multiple times in a tight loop Backport fix for dbclient threading issue when DML operations are executed multiple times in a tight loop in 2.4.2 Feb 3, 2022
@klustria klustria changed the title Backport fix for dbclient threading issue when DML operations are executed multiple times in a tight loop in 2.4.2 Fix dbclient threading issues when DML operations are executed multiple times in a tight loop Feb 3, 2022
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.

None yet

2 participants