Branch: refs/heads/release/jon3.3.x
Home:
https://github.com/rhq-project/rhq
Commit: f4d09f5c229d6d69ad556e4ae7fcba03a24ee513
https://github.com/rhq-project/rhq/commit/f4d09f5c229d6d69ad556e4ae7fcba0...
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: 2014-09-26 (Fri, 26 Sep 2014)
Changed paths:
M modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftFile.java
M
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
M
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java
A
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/purge/JPADriftFilePurge.java
M
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/purge/PurgeManagerBean.java
M
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/purge/PurgeManagerLocal.java
M
modules/enterprise/server/plugins/drift-rhq/src/main/java/org/rhq/enterprise/server/plugins/drift/JPADriftServerPluginComponent.java
Log Message:
-----------
Bug 1077744 - statement timeout during drift purge job
Changed the query WHERE clause: don't use NOT IN because NOT IN(NULL) will always
return false.
See
http://stackoverflow.com/questions/17150208/sql-query-with-not-in-returni...
In other words, if any row in RHQ_DRIFT as a NULL value in OLD_DRIFT_FILE or
NEW_DRIFT_FILE columns, we'll never purge anything.
Besides, the NOT EXISTS variant has a better execution plan.
Use PurgeTemplate to delete rows in batches and select the keys of the rows to delete
without locking the drift files table.
Also, some code cleanup.
(cherry picked from commit 3251090d63f58f0da3d604f30cc8f819533e0fcc)
Signed-off-by: Libor Zoubek <lzoubek(a)redhat.com>