From 60deb27bbd2da9d27202261c872d16a31edf99f4 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Mon, 20 Oct 2014 11:30:31 +0200 Subject: [PATCH] [#3696] OutOfMemoryError with SQL Azure, caused by long-running loop of consuming further exceptions --- jOOQ/src/main/java/org/jooq/impl/Utils.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/Utils.java b/jOOQ/src/main/java/org/jooq/impl/Utils.java index 4f37abab37..f66c3411a5 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Utils.java +++ b/jOOQ/src/main/java/org/jooq/impl/Utils.java @@ -346,6 +346,13 @@ final class Utils { */ private static Boolean isJPAAvailable; + /** + * [#3696] The maximum number of consumed exceptions in + * {@link #consumeExceptions(Configuration, PreparedStatement, SQLException)} + * helps prevent infinite loops and {@link OutOfMemoryError}. + */ + private static int maxConsumedExceptions = 256; + /** * A pattern for the dash line syntax */ @@ -2276,7 +2283,7 @@ final class Utils { xx xx xxxx xxxx xxxxx xxx xxxx xxxxxxxx xxxx xxxx xxx xxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x xxxx xxxxxxxxxx - xxxxxxxxxxxx xxx xxxx + xxxxxxxxxxxx xxx xxxx x x xx x x xxxxxxxxxxxxxxxxxxxxxx xxxx xxx x xx xxxxxxxxxxxxxxxxxxxxxxx xx xxxxxxxxxxxxxxxxxxxxx xx xxx xxxxx xxxxxxxxxxxx