candlepin/candlepin — pull request #802 by mstead (2014-12-22 19:52:22+00:00)
Title: Fixed broken consumer status report query

Postgres has a hard query parameter limit of 32767. Since
the report query had been using an IN criteria of active
consumer uuids, once the active consumer uuid records
passed the 32767 limit, our query would break.

This produced a rather useless error of:
org.postgresql.util.PSQLException: This connection has been closed.

Switching from criteria.list() to criteria.scroll() temporarily,
produced a better error presented itself.

The fix was to remove the IN clause, and incorporate the
'active' check into the overall main query.