jaiew / play-jooq

A JOOQ Play 2.1 module to enable JOOQ code generation
24 stars 7 forks source link

Avoid caching Connection in ConnectionProvider #12

Open lukaseder opened 8 years ago

lukaseder commented 8 years ago

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