Skip to content

Avoid caching Connection in ConnectionProvider#12

Open
lukaseder wants to merge 1 commit intojaiew:masterfrom
lukaseder:patch-2
Open

Avoid caching Connection in ConnectionProvider#12
lukaseder wants to merge 1 commit intojaiew:masterfrom
lukaseder:patch-2

Conversation

@lukaseder
Copy link
Copy Markdown

This practice has been seen a couple of times on the internet, in various sample projects, blog posts, etc. It is generally not a good idea to cache the Connection in a ConnectionProvider, as the ConnectionProvider should be stateless and threadsafe to be more generally useful, e.g. when injected via DI

For example, this user refers to your example and will probably get it wrong:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/play-framework/tXvA76ZQsJs/BoznOslsHwAJ

This practice has been seen a couple of times on the internet, in various sample projects, blog posts, etc. It is generally not a good idea to cache the Connection in a `ConnectionProvider`, as the `ConnectionProvider` should be stateless and threadsafe to be more generally useful, e.g. when injected via DI

For example, this user refers to your example and will probably get it wrong:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/play-framework/tXvA76ZQsJs/BoznOslsHwAJ
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.

1 participant