Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OutOfMemoryError with SQL Azure, caused by long-running loop of consuming further exceptions #3696

Closed
lukaseder opened this issue Oct 20, 2014 · 0 comments

Comments

@lukaseder
Copy link
Member

In SQL Server (and thus SQL Azure), jOOQ consumes exceptions with the following code:

consumeLoop: for (;;)
    try {
        if (!stmt.getMoreResults() && stmt.getUpdateCount() == -1)
            break consumeLoop;
    }
    catch (SQLException e) {
        previous.setNextException(e);
        previous = e;
    }

In some situations on SQL Azure, this can run almost indefinitely, and thus produce a lot of exceptions which will inevitably cause an OutOfMemoryError.

We should stop fetching more exceptions after a certain threshold (e.g. 256). Clearly, this threshold should eventually be made configurable (#3700)

@lukaseder lukaseder added this to the Version 3.5.0 milestone Oct 20, 2014
@lukaseder lukaseder changed the title OutOfMemoryException with SQL Azure, caused by long-running loop of consuming further exceptions OutOfMemoryError with SQL Azure, caused by long-running loop of consuming further exceptions Oct 20, 2014
lukaseder added a commit that referenced this issue Oct 20, 2014
lukaseder added a commit that referenced this issue Dec 23, 2014
================================================================================

This is a patch release with some useful fixes for the 3.2 branch

Bug fixes
---------
#3206 - DSL.field(Condition) doesn't correctly handle NULLs when
emulating boolean fields with a CASE expression
#3392 - Call setAccessible(true) only if really needed
#3402 - Wrong character length generated by jOOQ for Firebird
#3408 - Remove the default log4j.xml configuration file from the maven
plugin again
#3420 - NullPointerException when generating code for Oracle AQ Tables
#3427 - Internal QueryCollectorSignal exception escapes into user code
when not dealt with in ExecuteListener
#3430 - JDBC escape syntax is not correctly rendered from plain SQL
#3437 - QualifiedField does not respect RenderContext.qualify()
#3445 - Cannot run Maven code generator with professional edition
#3450 - Backslashes in SQL comments don't get escaped
#3463 - Field.in(...) methods shouldn't return trueCondition() or
falseCondition()
#3473 - java.lang.IllegalArgumentException: Field (null) is not
contained in Row
#3507 - Bad @Support annotation on Select.intersect() and
Select.except()
#3547 - DSLContext.batch(String) doesn't accept bind variables
#3571 - Converted Data Type does not propagate nullable and defaulted
properties
#3602 - Cannot INSERT into view
#3696 - OutOfMemoryException with SQL Azure, caused by long-running loop
of consuming further exceptions
#3762 - Bad emulation of DUAL table in HSQLDB when connecting with a DBA
user on a database with more than one user
#3811 - Potential NullPointerException in Cursor.fetchOne(RecordMapper)
and other methods
lukaseder added a commit that referenced this issue Feb 23, 2015
================================================================================

Bug fixes
---------

#3696 - OutOfMemoryException with SQL Azure, caused by long-running loop
of consuming further exceptions
#3705 - The jOOQ "flash log" doesn't display nicely when using
java.util.logging
#3711 - Incorrect code generated for cross-schema OBJECT type references
#3718 - Exceptions on rollback hide the original exceptions causing the
rollback
#3730 - Cannot use regex COMMENTS in <forcedType/>'s <expression/>
#3758 - ExecuteListener.warning() is not listed as a method in the
Javadoc
#3762 - Bad emulation of DUAL table in HSQLDB when connecting with a DBA
user on a database with more than one user
#3811 - Potential NullPointerException in Cursor.fetchOne(RecordMapper)
and other methods
#3824 - PostgreSQL dateAdd() erroneously returns a TIMESTAMP value
#3855 - Oracle REAL and FLOAT types cause code generator to produce
BigInteger instead of Double types
#3909 - Inefficient number to number conversion in
org.jooq.tools.Convert
#3915 - Calls to Configuration.derive() create a Configuration that
indirectly references the previous Configuration instance
#3919 - Bad caching of JPA-annotated getters leads to wrong mapping into
POJOs that have @ConstructorProperties
#3924 - Four octects are sent to Postgres for each negative byte in a
byte[]
#3936 - AbstractQuery unnecessarily creates two DefaultRenderContext
instances
#3940 - Batch statements do not work when queries contain inlined bind
variables
#3946 - Replace ArrayList<ExecuteListener> by ExecuteListener[] in
ExecuteListeners to avoid excessive Iterator creation
#3947 - Avoid creating unnecessary Iterators and ArrayLists in
AbstractStore.getAttachables()
#3957 - java.lang.NoSuchMethodException: createARRAY when using Oracle
arrays with BoneCP
#3962 - The H2 emulation of SHR might produce rounding errors
#3966 - Inefficient BIT_COUNT() function for those dialects that do not
natively support SHR()
#3977 - Meta.getTables() also returns entries for indexes for PostgreSQL
#3993 - ResultQuery.fetchAny() methods Javadoc erroneously claims
throwing of InvalidResultException
#4000 - Avoid {ResultSet | CallableStatement | SQLInput).wasNull() calls
if not necessary, as they're somewhat expensive on some JDBC drivers
#4022 - NullPointerException when generating SQLite table with composite
primary key
#4028 - Loader API's "onDuplicateKeyIgnore()" executes inefficient
SELECT
#4036 - Obsolete remark in RecordListener Javadoc about batch semantics
#4056 - Query.bind(String, Object) binds only to the first occurrence of
a named bind value
#4065 - Exception when loading array results from plain SQL queries into
a Record
#4075 - Bad result from Query.getBindValues() when named Params are
repeated
lukaseder added a commit that referenced this issue Feb 23, 2015
================================================================================

Bug fixes
---------

#3696 - OutOfMemoryException with SQL Azure, caused by long-running loop
of consuming further exceptions
#3705 - The jOOQ "flash log" doesn't display nicely when using
java.util.logging
#3711 - Incorrect code generated for cross-schema OBJECT type references
#3718 - Exceptions on rollback hide the original exceptions causing the
rollback
#3730 - Cannot use regex COMMENTS in <forcedType/>'s <expression/>
#3758 - ExecuteListener.warning() is not listed as a method in the
Javadoc
#3762 - Bad emulation of DUAL table in HSQLDB when connecting with a DBA
user on a database with more than one user
#3811 - Potential NullPointerException in Cursor.fetchOne(RecordMapper)
and other methods
#3824 - PostgreSQL dateAdd() erroneously returns a TIMESTAMP value
#3855 - Oracle REAL and FLOAT types cause code generator to produce
BigInteger instead of Double types
#3909 - Inefficient number to number conversion in
org.jooq.tools.Convert
#3915 - Calls to Configuration.derive() create a Configuration that
indirectly references the previous Configuration instance
#3919 - Bad caching of JPA-annotated getters leads to wrong mapping into
POJOs that have @ConstructorProperties
#3924 - Four octects are sent to Postgres for each negative byte in a
byte[]
#3936 - AbstractQuery unnecessarily creates two DefaultRenderContext
instances
#3940 - Batch statements do not work when queries contain inlined bind
variables
#3946 - Replace ArrayList<ExecuteListener> by ExecuteListener[] in
ExecuteListeners to avoid excessive Iterator creation
#3947 - Avoid creating unnecessary Iterators and ArrayLists in
AbstractStore.getAttachables()
#3957 - java.lang.NoSuchMethodException: createARRAY when using Oracle
arrays with BoneCP
#3962 - The H2 emulation of SHR might produce rounding errors
#3966 - Inefficient BIT_COUNT() function for those dialects that do not
natively support SHR()
#3977 - Meta.getTables() also returns entries for indexes for PostgreSQL
#3993 - ResultQuery.fetchAny() methods Javadoc erroneously claims
throwing of InvalidResultException
#4000 - Avoid {ResultSet | CallableStatement | SQLInput).wasNull() calls
if not necessary, as they're somewhat expensive on some JDBC drivers
#4022 - NullPointerException when generating SQLite table with composite
primary key
#4028 - Loader API's "onDuplicateKeyIgnore()" executes inefficient
SELECT
#4036 - Obsolete remark in RecordListener Javadoc about batch semantics
#4056 - Query.bind(String, Object) binds only to the first occurrence of
a named bind value
#4065 - Exception when loading array results from plain SQL queries into
a Record
#4075 - Bad result from Query.getBindValues() when named Params are
repeated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant