Hi Lukas, I don't know if the wording is incorrect or if the contract is loose in a way that may cause problems (and does not satisfy what I hoped I could do with it).
acquire(): Provide jOOQ with a Connection. The ConnectionProvider can > freely choose, whether this connection is a new connection every time > jOOQ calls this method, or if the same connection will be provided > again and again. The "again and again" part is true provided that it was first released, is that correct? What I expect is acquire to reserve a connection. A new call to acquire would reserve another connection. The only way to release a connection is to release it. Otherwise, if the same provider is used by 2 different threads, it is unclear whether serving the same connection is a good thing. > release(): Clean up a Connection that was previously provided to jOOQ. > The ConnectionProvider can freely choose, whether cleaning up needs > any action or not. jOOQ will call this method exactly once per > execution, when the ExecuteContext is disposed (before > ExecuteListener.end()) > I don't see why the connection provider javadoc mentions jOOQ execution lifecycle. In my view, connection provider should be a generic utility, with a Javadoc that reads: acquire(): Reserve and return a connection for dedicated use to the caller. The caller must release this connection when finished. Note that this method could be implemented to always return a new connection or take one from a pool. release(Connection): Indicate that a connection previously obtained through acquire() is not needed anymore and can be disposed or made available to future calls to acquire(). This way, other tools/APIs could make use of that Connection Provider. Hope this helps, -Christopher -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
