Hi Lukas,

> There is this new ConnectionProvider type:
> http://www.jooq.org/javadoc/latest/org/jooq/ConnectionProvider.html
>

I don't understand the Javadoc...
acquire:
"The general contract is that a ConnectionProvider is expected to always
return the same connection, until this connection is returned by jOOQ
through release(Connection)."
release:
"The general contract is that a ConnectionProvider must not generate a new
connection in acquire(), before a previous connection is returned."

It seems to say that:
Connection c1 = p.acquire();
Connection c2 = p.acquire();
=> c1 == c2;
And in that case, do we have to release it twice too?

so if a user sets a connection provider for things like the SQL Console
(that is multi tabs, etc.) we have no way of acquiring/releasing new
connections for different concurrent usages using a (shared)
ConnectionProvider. We don't want the user to supply a
ConnectionProviderFactory for that :)

Instead, I would expect acquire() to always return a new unused connection
(e.g.: creation or taken from a pool), and release() to notify that it is
now unused (can be disposed or placed back into a pool).

Or maybe there is something I am missing with regards to how JDBC
connections work? Also consider that I expected one ConnectionProvider
which multiple threads could call to acquire new connections (and I am not
sure the same connection can be used by multiple threads).

Cheers,
-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.


Reply via email to