Skip to content Skip to sidebar Skip to footer

Overriding Jooq's Exception Handling For Updatablerecords

I'm using jOOQ v2.6 as I'm using SQL Server 2008 R2 and there is a bug in jOOQ v3.1 which causes code generation to fail. (I'm aware this will be fixed in v3.2). From the manual:

Solution 1:

I'm not 100% sure if this will meet your actual requirements, but using an ExecuteListener, you can hook into jOOQ's general query execution lifecycle and inject some behaviour into jOOQ's exception handling. Some examples are given here:

http://www.jooq.org/doc/3.1/manual/sql-execution/execute-listeners

In particular, your custom ExecuteListener might look like this:

publicclassMyListenerextendsDefaultExecuteListener {

    @Overridepublicvoidexception(ExecuteContext ctx) {
        // Put some logic here
    }
}

Note, this currently won't prevent the throwing of the exception, itself.

Post a Comment for "Overriding Jooq's Exception Handling For Updatablerecords"