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

tweaking connection pool to reuse specific connection #303

Open
awoc77 opened this issue Feb 25, 2022 · 0 comments
Open

tweaking connection pool to reuse specific connection #303

awoc77 opened this issue Feb 25, 2022 · 0 comments

Comments

@awoc77
Copy link

awoc77 commented Feb 25, 2022

Hi,
We started to use cursors with hold in our project. Connection pool, that we use, has multiple connections.
Cursors with hold are connection-specific in postgresql, so they are visible only in the connection, in which they've been created. Using connection pool means, that in next execute, connection without cursor might be used, thus failing to access it.

Simplest solution would be to always use single connection for operations concerning cursors with hold, but it has obvious performance implications.
We wonder if it is possible to tweak our code/ozo code to solve this issue without abandoning multiple-connection pool.

Mechanism I can think of right now would require:

  • ozo::execute (creating cursor, providing connection pool to be used) get information back about which connection was eventually used.
  • next ozo::execute (using cursor created before) use connection that was in previous step

What do you think about this solution? Any hints on implementing it?
Or can you think about other solution to this problem?

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

No branches or pull requests

1 participant