Bug 722898

Summary: Updating operation definitions fail during plugin update when the operation has a history
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: Core ServerAssignee: Heiko W. Rupp <hrupp>
Status: CLOSED UPSTREAM QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.1CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-10 18:10:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Heiko W. Rupp 2011-07-18 12:37:29 UTC
14:33:00,285 INFO  [ProductPluginDeployer] Deploying [1] new or updated agent plugins: [jboss-as-7]
14:33:01,920 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: 23503
14:33:01,921 ERROR [JDBCExceptionReporter] Batch-Eintrag 0 delete from RHQ_OPERATION_DEF where ID='10321' wurde abgebrochen.  Rufen Sie 'getNextException' auf, um die Ursache zu erfahren.
14:33:01,921 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: 23503
14:33:01,922 ERROR [JDBCExceptionReporter] ERROR: update or delete on table "rhq_operation_def" violates foreign key constraint "rhq_operation_history_operation_def_id_fkey" on table "rhq_operation_history"
  Detail: Key (id)=(10321) is still referenced from table "rhq_operation_history".
14:33:01,922 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
....
        at $Proxy203.updateMetadata(Unknown Source)
        at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.mergeExistingType(ResourceMetadataManagerBean.java:403)
        at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.updateType(ResourceMetadataManagerBean.java:375)
        at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.updateTypes(ResourceMetadataManagerBean.java:141)
        at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.updateTypes(ResourceMetadataManagerBean.java:150)
        at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.updateTypes(ResourceMetadataManagerBean.java:150)

Comment 1 Heiko W. Rupp 2011-07-20 08:51:03 UTC
 366dd99b76cd in branch as7plugin

Comment 2 Heiko W. Rupp 2011-07-21 12:08:03 UTC
b87c6db1237fb in master

QA: to test: deploy a plugin with an operation. Execute the operation. Execute 
an other operation on the same plugin. Then in the plugin descriptor change the 
name of the first operation, rebuild the plugin, deploy. Deployment must go 
well. History for the 2nd operation must stay there.