What I observe is trait purging can cause locks on the RHQ_MEASUREMENT_DATA_TRAIT table.
22:13:17,477 INFO [org.rhq.enterprise.server.scheduler.jobs.DataPurgeJob] (RHQScheduler_Worker-5) Trait data purge starting at Mon Mar 03 22:13:17 UTC 2014 22:13:17,477 INFO [org.rhq.enterprise.server.scheduler.jobs.DataPurgeJob] (RHQScheduler_Worker-5) Purging traits that are older than Wed Sep 04 22:13:17 UTC 2013 22:27:55,234 INFO [org.rhq.enterprise.server.scheduler.jobs.DataPurgeJob] (RHQScheduler_Worker-5) Traits data purged [17421] - completed in [877757]ms
During this time, I observed the following locks:
2014-03-03 22:24:21 Object Terminal Machine Locker Wait Seconds Lockmode Object Type Session ID Serial sid 2014-03-03 22:24:21 ('RHQ.RHQ_MEASUREMENT_DATA_TRAIT', 'rhq', 'xxx', 'RHQ', 'ACTIVE', 3, 'ROW EXCLUSIVE', 'TABLE', 972, 10651, 972) 2014-03-03 22:24:22 not found sid 972 serial 10651 2014-03-03 22:24:22 ('RHQ.RHQ_MEASUREMENT_DATA_TRAIT', 'rhq', 'xxx', 'RHQ', 'ACTIVE', 12, 'ROW EXCLUSIVE', 'TABLE', 1166, 49959, 1166) 2014-03-03 22:24:23 not found sid 1166 serial 49959
I'm not filing a bug, since I know traits will be moved to Cassandra, but definitely a problem with the existing purge process.
There might be something similar to availability purge, but I haven't seen a problem there.
To work around, I'm basically setting the trait purge time to 700+ days and waiting for RHQ 4.11 :-)