[#3234] Handle also RuntimeExceptions

This commit is contained in:
Lukas Eder 2014-05-06 12:22:55 +02:00
parent 6f63e5f55f
commit 6d482ab35e
5 changed files with 26 additions and 1 deletions

View File

@ -331,6 +331,11 @@ abstract class AbstractQuery extends AbstractQueryPart implements Query, Attacha
result = execute(ctx, listener);
return result;
}
catch (RuntimeException e) {
ctx.exception(e);
listener.exception(ctx);
throw ctx.exception();
}
catch (SQLException e) {
ctx.sqlException(e);
listener.exception(ctx);

View File

@ -303,6 +303,11 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
fetchOutParameters(ctx);
return 0;
}
catch (RuntimeException e) {
ctx.exception(e);
listener.exception(ctx);
throw ctx.exception();
}
catch (SQLException e) {
ctx.sqlException(e);
listener.exception(ctx);
@ -325,7 +330,7 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
consumeExceptions(ctx.configuration(), ctx.statement(), e);
throw e;
}
finally {
consumeWarnings(ctx, listener);
}

View File

@ -113,6 +113,11 @@ class BatchMultiple implements Batch {
consumeWarnings(ctx, listener);
}
}
catch (RuntimeException e) {
ctx.exception(e);
listener.exception(ctx);
throw ctx.exception();
}
catch (SQLException e) {
ctx.sqlException(e);
listener.exception(ctx);

View File

@ -166,6 +166,11 @@ class BatchSingle implements BatchBindStep {
consumeWarnings(ctx, listener);
}
}
catch (RuntimeException e) {
ctx.exception(e);
listener.exception(ctx);
throw ctx.exception();
}
catch (SQLException e) {
ctx.sqlException(e);
listener.exception(ctx);

View File

@ -1415,6 +1415,11 @@ class CursorImpl<R extends Record> implements Cursor<R> {
rows++;
}
}
catch (RuntimeException e) {
ctx.exception(e);
listener.exception(ctx);
throw ctx.exception();
}
catch (SQLException e) {
ctx.sqlException(e);
listener.exception(ctx);