Bug 965342 - Alert updates; Hibernate lazy load exception for Numeric Type
Alert updates; Hibernate lazy load exception for Numeric Type
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Alerts (Show other bugs)
4.5
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: RHQ 4.8
Assigned To: Heiko W. Rupp
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-20 20:56 EDT by Elias Ross
Modified: 2013-09-11 05:53 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-11 05:53:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Elias Ross 2013-05-20 20:56:32 EDT
2013-05-21 00:45:07,106 WARN  [org.rhq.enterprise.gui.coregui.server.gwt.AlertTemplateGWTServiceImpl] Sending exception to client: [1369097107106] 
org.rhq.enterprise.server.alert.AlertDefinitionUpdateException: Failed to update child AlertDefinitions [15555, 15556, 15557, 15558, 15559, 15560, 15561, 1556
2, 15563, 15564, 15565, 15566, 15567, 15568, 15569, 15570, 15571, 15572]; 
        at org.rhq.enterprise.server.alert.AlertTemplateManagerBean.updateAlertTemplate(AlertTemplateManagerBean.java:307)

...

Caused by: org.hibernate.LazyInitializationException: could not initialize proxy - no Session
        at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
        at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
        at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:166)
        at org.rhq.core.domain.measurement.MeasurementDefinition_$$_javassist_36.getNumericType(MeasurementDefinition_$$_javassist_36.java)

The bug is probably fixed with this:

diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java b/modules/enterprise/server/jar/src/m
index 0b3ff87..84c9872 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
@@ -650,9 +650,9 @@ private void checkAlertDefinition(Subject subject, AlertDefinition persistedAler
             if (alertConditionCategory == AlertConditionCategory.BASELINE) {
 
                 MeasurementDefinition def = alertCondition.getMeasurementDefinition();
+                def = entityManager.getReference(MeasurementDefinition.class, def.getId());
                 NumericType numType = def.getNumericType();
                 if (numType == null) {
-                    def = entityManager.getReference(MeasurementDefinition.class, def.getId());
                     numType = def.getNumericType();
                 }
                 if (numType != NumericType.DYNAMIC) {
Comment 1 Heiko W. Rupp 2013-06-18 11:21:05 EDT
To reproduce:

create an alert template with a Baseline.
save it.
Then edit the template and edit the baseline condition. Save.
Comment 2 Heiko W. Rupp 2013-06-18 11:36:33 EDT
master 26b1b5e27
Comment 3 Heiko W. Rupp 2013-09-11 05:53:10 EDT
Bulk closing of old issues now that HRQ 4.9 is in front of the door.

If you think the issue has not been solved, then please open a new bug and mention this one in the description.

Note You need to log in before you can comment on or make changes to this bug.