Bug 753827
| Summary: | Globally uncaught exception pinning drift definition to new template | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Other] RHQ Project | Reporter: | Mike Foley <mfoley> | ||||||||
| Component: | drift | Assignee: | RHQ Project Maintainer <rhq-maint> | ||||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> | ||||||||
| Severity: | high | Docs Contact: | |||||||||
| Priority: | medium | ||||||||||
| Version: | 4.2 | CC: | jsanda | ||||||||
| 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: | 2012-02-07 19:20:38 UTC | Type: | --- | ||||||||
| 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: | 707225 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Mike Foley
2011-11-14 16:07:13 UTC
Created attachment 533559 [details]
image of client-side error
Created attachment 533560 [details]
text of client-side error
server-side exception: 2011-11-14 10:50:08,808 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00001: unique constraint (RHQ.RHQ_DRIFT_DEF_TEMPLATE_UNIQUE) violated 2011-11-14 10:50:08,808 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 1, SQLState: 23000 2011-11-14 10:50:08,808 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00001: unique constraint (RHQ.RHQ_DRIFT_DEF_TEMPLATE_UNIQUE) violated 2011-11-14 10:50:08,808 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session org.hibernate.exce Created attachment 533561 [details]
server logs
The underlying problem here is that template names for a resource type have to be unique. There currently is no validation in place to enforce this. I have made three changes that provide validation:
1) Add validation check in DriftTemplateManagerBean.createTemplate. An IllegalArgumentException is thrown if the name is a duplicate. This handles calls through the remote api as well as through the UI.
2) Add a validation check to the wizard in the drift templates view. If you specify a duplicate name, the name field is flagged as being in error when you click finish. The hover text says that the name must be unique.
3) Add the same validation check as in 2) to the wizard for pinning a snapshot to a template.
master commit hash: 2594fa3706f30dd43c7aa566a6f4b5154ffdc863
release_jon3.x commit hash: 29ee2dea37ab4a2720f7d4dd5926acdeb37d4588
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE |