On 12/11/2014 7:15 AM, Lukas Eder wrote:
...
Here's the point: ConnectionProvider is an SPI
(http://en.wikipedia.org/wiki/Service_provider_interface), not an
"ordinary" API
(http://en.wikipedia.org/wiki/Application_programming_interface). This
means that you provide an implementation for jOOQ to call (SPI),
instead of jOOQ providing an implementation for you to call (API).
Things might still work, but they *feel* quirky, right? Intuition is
usually a good guide. When something doesn't "feel" right, it probably
isn't.
To my colleague's defense, he did go ahead and release the connection later:
} finally {
try {
if (connection != null) {
connection.setAutoCommit(originalAutoCommit);
dslContext.configuration().connectionProvider().release(connection);
}
} catch (SQLException e) {
throw new IOException(e.getMessage(), e);
}
}
So basically he was doing what jOOQ would have done, which gave him a
connection to pass around. This was probably the best way to get a
connection without access to the original data source. Of course I wish
he would have passed around something that wasn't so low-level, like
putting a jOOQ transaction in front of it. Now ULTM would provide
something higher-level to pass around, if one really wants to pass
around something.
Garret
--
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/d/optout.