Description of problem: If there is no component version, in other words an empty string, this is stored as ''. Oracle translates this value into null when read. Then the RHQ agent thinks the version was changed for this resource. 2012-09-26 18:57:07,396 INFO [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Version of [Resource[id=59062, type=Script, key=twiddle.sh, name=twiddle.sh, parent=AS default8180]] changed from [null] to [] The change is fairly straightforward diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq index b3f7fa9..8745971 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java @@ -2683,7 +2683,7 @@ private InventoryContext getInventoryContext(Resource resource) { private void updateResourceVersion(Resource resource, String version) { String existingVersion = resource.getVersion(); - boolean versionChanged = (existingVersion != null) ? !existingVersion.equals(version) : version != null; + boolean versionChanged = (existingVersion != null) ? !existingVersion.equals(version) : version != null && !version.isEmpty(); if (versionChanged) { if (log.isDebugEnabled()) { log.debug("Discovery reported that version of [" + resource + "] changed from [" + existingVersion
Alternatively, the server could convert null strings into empty strings when loading from Oracle. I have done this before using Hibernate/JPA by annotating a @PostLoad method.
Mazz I think this makes sense - those change messages are annoying. What do you think?
i'll take a look. it seems to make sense to change this.
I made that change to master branch. git commit 6ee04e0