Bug 988581

Summary: Hibernate StaleState Exception when adding multiple Metrics to Dashboards via new Consolidated Metrics screen
Product: [Other] RHQ Project Reporter: Mike Thompson <mithomps>
Component: Core UIAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.9CC: 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: 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:

Description Mike Thompson 2013-07-25 21:54:45 UTC
Description of problem:
With the new Consolidated metrics screen, we can now add multiple metric graphs to dashboards in a single click via selecting multiple metric rows and pushing the  'Add to Dashboard' button. This new capability of adding multiple is now causing hibernate staleState exceptions.


Version-Release number of selected component (if applicable):
RHQ 4.9.0 snapshot after merge of Consolidated Metrics

How reproducible:
Sometimes, depends on load.


Steps to Reproduce:
1.For a resource go to the inventory detail --> monitor --> metrics tab (http://192.x.x.x:7080/coregui/#Resource/10021/Monitoring/Metrics)
2.Select several metric rows
3.Click the 'Add To Dashboard' button.

Actual results:
Thursday, July 25, 2013 2:43:59 PM UTC-7
Root Cause :	
org.hibernate.StaleStateException:Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
Detail :	

java.lang.RuntimeException:[1374788639526] javax.ejb.EJBTransactionRolledbackException:Transaction rolled back -> javax.transaction.RollbackException:ARJUNA016053: Could not commit transaction. -> javax.persistence.OptimisticLockException:org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 -> org.hibernate.StaleStateException:Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
--- STACK TRACE FOLLOWS ---
[1374788639526] javax.ejb.EJBTransactionRolledbackException:Transaction rolled back -> javax.transaction.RollbackException:ARJUNA016053: Could not commit transaction. -> javax.persistence.OptimisticLockException:org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 -> org.hibernate.StaleStateException:Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
   at Unknown.anonymous(Unknown Source)
   at Unknown.anonymous(Unknown Source)
  


Expected results:
No Errors.