Bug 997609

Summary: Drift cannot be updated with > 1000 resources; ORA-01795
Product: [Other] RHQ Project Reporter: Elias Ross <genman>
Component: driftAssignee: Heiko W. Rupp <hrupp>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.8CC: hrupp
Target Milestone: ---   
Target Release: RHQ 4.10   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-23 12:31:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch for RHQ_4_9_0
none
Patch for RHQ_4_9_0 v2 none

Description Elias Ross 2013-08-15 18:56:05 UTC
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-/0.0.0.0:7080-1) 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-/0.0.0.0:7080-1) SQL Error: 1795, SQLState: 42000
18:37:17,051 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:7080-1) ORA-01795: maximum number of expressions in a list
 is 1000
18:37:17,057 ERROR [org.jboss.as.ejb3.invocation] (http-/0.0.0.0:7080-1) 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-11.2.0.3.0.jar:11.2.0.2.0]
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) [ojdbc6-11.2.0.3.0.jar:11.2.0.2.0]


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 20:11:09 UTC
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 20:09:58 UTC
Created attachment 857965 [details]
Patch for RHQ_4_9_0 v2

Fixed the patch

Comment 3 Heiko W. Rupp 2014-02-18 12:36:02 UTC
My bad - setting it back to 4.10 as a patch is included already

Comment 4 Heiko W. Rupp 2014-02-18 17:18:17 UTC
master c151d90e8cc6094bde2930bb3898f0850738b0fc

Thanks Elias!

Comment 5 Heiko W. Rupp 2014-04-23 12:31:13 UTC
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.