Hello,

The Factory object is very light, so it's not a problem instantiate it for
each request in FactoryProxy.
Solution with FactoryProxy makes possible to use JooQ in Spring environmen,
it's simple but not optimal.
The major drawback of this solution is a necessity to declare all service
methods as "Transactional", because TransactionInterceptor cares about
closing of connections in this case.

It would be great to configure Factory with DataSource, instead of
Connection.
There are several places in jOOQ (search usages of  method Util.translate,
for example in AbstractQuery.execute() ), where we can receive connection
from DataSource, execute statement and close connection (return it to
connection pool).
For backward compatibility (in Connection-based Factory constructor) it's
possible to wrap Connection to  SingleConnectionDataSource for internal
usage.
Another advantage of using DataSource in internal jOOQ API - connection can
be returned to pool as fast as possible.

Regarding separation executing and sql rendering concerns.
I like current jOOQ API and I suppose that much better to write
factory.select(..).fetch()
than something like
executor.fetch(factory.select(...))
This is one of the reasons why I do not like to use JdbcTemplate with jOOQ.

--
Best regards,

Reply via email to