Bug 913698

Summary: Hibernate StaleObjectState exception when deleting entitled system units
Product: [Community] Candlepin Reporter: Jon Allen <jallen>
Component: candlepinAssignee: Jesus M. Rodriguez <jesusr>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 0.9CC: bkearney, jallen, jesusr
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-19 14:21:33 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:
Bug Depends On:    
Bug Blocks: 840995    

Description Jon Allen 2013-02-21 20:03:36 UTC
Description of problem:
When I create multiple (3-5) system units and add 10-30 subscriptions to each, and then delete the units, a hibernate stale object exception is thrown.
Stack trace at:
http://pastebin.test.redhat.com/129222

Version-Release number of selected component (if applicable):

How reproducible:
So far I have only seen this using the heavily shared rhn-cservice-acarter account, which lends credence to our theory that another user is changing the data while I am trying to delete it. I am trying to reproduce it across environments and accounts, but so far have only seen it at Prod, and only with this account. I will update this BZ when I have more info.

Steps to Reproduce (through RHSM Web):
1. login to access.redhat.com/management as rhn-cservice-acarter
2. create 5 system units. I alternated between physical and virtual systems.
3. add all available subscriptions to each one. Make sure to un-check the "Only show subscriptions that match this System" checkbox.
4. Once all 5 units are created and subscribed, delete them all at once.
  
Actual results:
You will see a 500 in the RHSM Web UI and a org.hibernate.StaleObjectStateException in the catalina log.

Expected results:
Units and entitlements should be deleted cleanly.

Additional info:

Comment 1 Bryan Kearney 2013-02-22 03:03:54 UTC
what version of candlepin is this?

Comment 2 Jesus M. Rodriguez 2013-07-01 20:34:59 UTC
Please do NOT use pastebin urls for stack traces in bugs, they do not live long enough to be useful. It is preferable that we make an attachment with the contents of the log.

Comment 3 Jesus M. Rodriguez 2013-07-01 20:58:59 UTC
Can we get a copy of the log from prod that contains this error?