Bug 997609 - Drift cannot be updated with > 1000 resources; ORA-01795
Drift cannot be updated with > 1000 resources; ORA-01795
Product: RHQ Project
Classification: Other
Component: drift (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: RHQ 4.10
Assigned To: Heiko W. Rupp
Mike Foley
Depends On:
  Show dependency treegraph
Reported: 2013-08-15 14:56 EDT by Elias Ross
Modified: 2014-04-23 08:31 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-04-23 08:31:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch for RHQ_4_9_0 (2.59 KB, patch)
2014-01-28 15:11 EST, Elias Ross
no flags Details | Diff
Patch for RHQ_4_9_0 v2 (2.60 KB, patch)
2014-01-31 15:09 EST, Elias Ross
no flags Details | Diff

  None (edit)
Description Elias Ross 2013-08-15 14:56:05 EDT
Related to Bug 720762. I have a host with 10000 resources, and this is what is says:

18:37:17,009 WARN  [org.hibernate.internal.AbstractQueryImpl] (http-/ HHH000443: Dialect [org.hibernate.dialect.Oracle10gDialect
] limits the number of elements in an IN predicate to 1000 entries.  However, the given parameter list [resourceIds] contained 10003 entries, w
hich will likely cause failures to execute the query in the database
18:37:17,050 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/ SQL Error: 1795, SQLState: 42000
18:37:17,051 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/ ORA-01795: maximum number of expressions in a list
 is 1000
18:37:17,057 ERROR [org.jboss.as.ejb3.invocation] (http-/ JBAS014134: EJB Invocation failed on component DriftManagerBean for method public abstract org.rhq.core.domain.util.PageList org.rhq.enterprise.server.drift.DriftManagerRemote.findDriftDefinitionsByCriteria(org.rhq.core.domain.auth.Subject,org.rhq.core.domain.criteria.DriftDefinitionCriteria): javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet

Caused by: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000

	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440) [ojdbc6-]
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) [ojdbc6-]

You can reproduce using an agent, e.g. rhq-agent-env.sh:

RHQ_AGENT_JAVA_OPTS="-Xms64m -Xmx512m -Djava.net.preferIPv4Stack=true"
RHQ_AGENT_ADDITIONAL_JAVA_OPTS="-Drhq.perftest.scenario=configurable-average -Drhq.perftest.server-a-count=100 -Drhq.perftest.service-a-count=10 -Drhq.perftest.service-ab-count=10"

See: https://hibernate.atlassian.net/browse/HHH-1123
Comment 1 Elias Ross 2014-01-28 15:11:09 EST
Created attachment 856821 [details]
Patch for RHQ_4_9_0

Haven't been extensively tested with Drift yet. Works for resources without drift.
Comment 2 Elias Ross 2014-01-31 15:09:58 EST
Created attachment 857965 [details]
Patch for RHQ_4_9_0 v2

Fixed the patch
Comment 3 Heiko W. Rupp 2014-02-18 07:36:02 EST
My bad - setting it back to 4.10 as a patch is included already
Comment 4 Heiko W. Rupp 2014-02-18 12:18:17 EST
master c151d90e8cc6094bde2930bb3898f0850738b0fc

Thanks Elias!
Comment 5 Heiko W. Rupp 2014-04-23 08:31:13 EDT
Bulk closing of 4.10 issues.

If an issue is not solved for you, please open a new BZ (or clone the existing one) with a version designator of 4.10.

Note You need to log in before you can comment on or make changes to this bug.