Skip to content

feat: enable session leaks prevention by cleaning up long-running tra… #2655

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

Merged
merged 6 commits into from
Nov 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update session-and-channel-pool-configuration.md
Co-authored-by: Knut Olav Løite <[email protected]>
  • Loading branch information
arpan14 and olavloite authored Oct 5, 2023
commit 6db9260b46fa3d5fea89eb6496a74e85595ab8b1
3 changes: 1 addition & 2 deletions session-and-channel-pool-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ transactions. When we perform a read in a read-write transaction we still need t

As shown in the example below, the `try-with-resources` block releases the session after it is complete.
If you don't use `try-with-resources` block, unless you explicitly call the `close()` method on all resources
such as `ResultSet` the session is not released back to the pool. If the transaction does not run within
`try-with-resources` block and if we don't close the resources explicitly, we will have a session leak.
such as `ResultSet`, the session is not released back to the pool.

```java
DatabaseClient client =
Expand Down