Hello,
My standard code for database calls looks like the following
try (KrJooqWrapper wrapper = new KrJooqWrapper(DbType.MAIN)) {
int rows = wrapper.getCreate()
.deleteFrom(TABLE)
.where(TABLE.ID.eq(123))
.execute();
return rows > 0;
}
catch (Exception e) {
Log.exception(e);
return false;
}
I am currently using a custom DefaultExecuteListener which does
- SQL query logging on exception
- SQL query logging if in debug mode
- On render end, block any UPDATE or DELETE that does not have a where
clause
- timeout on long queries
My question is, is there a way I can retry a query/transaction on a
SQLException (in case of deadlocks, for example) so that I do not have to
re-write my application code (by wrapping it around a retry function). I
could probably rerun the query in the DefaultExecuteListener exception
handler, but that would require another connection, probably. Plus it
would still throw the original exception to the application.
--
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.