Hi,
i have a problem with the setAutoCommit Option, this is not working in JOOQ
2.6.1 and now i want migrate to JOOQ 3.2 i hope this will resolve my
AutoCommit Problem.. i use the Tomcat Pooling and a Postgres Database. Here
are some Infos how i have configured my pooling
http://stackoverflow.com/questions/20589693/autocommit-did-not-work-with-jooq-2-6-1-and-tomcat-pooling
At the Moment i use JOOQ 2.6.1 with Spring. In the old Version with 2.6.1
i have used a Factory and now i have migrate it from
public Factoryt createFactory() {
Settings settings = new Settings();
settings.getExecuteListeners().add(
"de.si.srv.data.SpringExceptionTranslationExecuteListener");
return new Factory(dataSource, SQLDialect.POSTGRES, settings);
}
TO
public DSLContext createFactory() {
//Settings settings = new Settings();
/*settings.getExecuteListeners().add(
"de.si.srv.data.SpringExceptionTranslationExecuteListener");*/
DSLContext create = DSL.using(dataSource, SQLDialect.POSTGRES);
return create;
}
is this correct and what is with the Settings and the
SpringExceptionTranslationExecuteListener? The getExecuteListeners() is not
supported in JOOQ 3.2
My SpringExceptionTranslationExecuteListener looks like this:
public class SpringExceptionTranslationExecuteListener extends
DefaultExecuteListener {
@Override
public void start(ExecuteContext ctx) {
DataSource dataSource = ctx.getDataSource();
Connection c = DataSourceUtils.getConnection(dataSource);
ctx.setConnection(c);
}
@Override
public void exception(ExecuteContext ctx) {
SQLException ex = ctx.sqlException();
Statement stmt = ctx.statement();
Connection con = ctx.getConnection();
DataSource dataSource = ctx.getDataSource();
JdbcUtils.closeStatement(stmt);
ctx.exception(getExceptionTranslator(dataSource).translate("jOOQ",
ctx.sql(), ex));
}
/**
* Return the exception translator for this instance.
* <p>
* Creates a default {@link SQLErrorCodeSQLExceptionTranslator} for the
* specified DataSource if none set, or a
* {@link SQLStateSQLExceptionTranslator} in case of no DataSource.
*/
public synchronized SQLExceptionTranslator getExceptionTranslator(
DataSource dataSource) {
final SQLExceptionTranslator exceptionTranslator;
if (dataSource != null) {
exceptionTranslator = new SQLErrorCodeSQLExceptionTranslator(
dataSource);
} else {
exceptionTranslator = new SQLStateSQLExceptionTranslator();
}
return exceptionTranslator;
}
}
But ctx.getConnection(); and ctx.getDataSource(); are not supported in
JOOQ 3.2 do i still need the SpringExceptionTranslationExecuteListener in
Jooq 3.2 ?
What is the easiest way to implement Transaction Handling with Jooq 3.2 !?
Best regards
--
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.