Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 978925

Summary: Ticket Monster: generated Administration section does not perform deletion of Performances correctly
Product: [Retired] JBoss Enterprise WFK Platform 2 Reporter: Vineet Reynolds <vpereira>
Component: TicketMonsterAssignee: Pete Muir <pmuir>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Tomas Repel <trepel>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.3.0CC: bsutter, mnovotny, ppenicka
Target Milestone: ---   
Target Release: 2.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
The generated Administration section of the TicketMonster example does not contain the correct logic to delete Performances. Consequently, deleting Performances in the Administration section has no effect, or failures are encountered during the deletion. To work around the issue, add the following methods to the PerformanceBean class: public List<SectionAllocation> findSectionAllocationsByPerformance(Performance performance) { CriteriaQuery<SectionAllocation> criteria = this.entityManager .getCriteriaBuilder().createQuery(SectionAllocation.class); Root<SectionAllocation> from = criteria.from(SectionAllocation.class); CriteriaBuilder builder = this.entityManager.getCriteriaBuilder(); Predicate performanceIsSame = builder.equal(from.get("performance"), performance); return this.entityManager.createQuery( criteria.select(from).where(performanceIsSame)).getResultList(); } public List<Booking> findBookingsByPerformance(Performance performance) { CriteriaQuery<Booking> criteria = this.entityManager .getCriteriaBuilder().createQuery(Booking.class); Root<Booking> from = criteria.from(Booking.class); CriteriaBuilder builder = this.entityManager.getCriteriaBuilder(); Predicate performanceIsSame = builder.equal(from.get("performance"), performance); return this.entityManager.createQuery( criteria.select(from).where(performanceIsSame)).getResultList(); } Then replace the delete() method in the PerformanceBean class with the following method definition: public String delete() { this.conversation.end(); try { Performance deletableEntity = findById(getId()); Show show = deletableEntity.getShow(); show.getPerformances().remove(deletableEntity); deletableEntity.setShow(null); this.entityManager.merge(show); List<SectionAllocation> sectionAllocations = findSectionAllocationsByPerformance(deletableEntity); for(SectionAllocation sectionAllocation: sectionAllocations) { this.entityManager.remove(sectionAllocation); } List<Booking> bookings = findBookingsByPerformance(deletableEntity); for(Booking booking: bookings) { this.entityManager.remove(booking); } this.entityManager.remove(deletableEntity); this.entityManager.flush(); return "search?faces-redirect=true"; } catch (Exception e) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(e.getMessage())); return null; } } After applying this workaround, Performances can be deleted in the Administration section successfully.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-17 21:42:10 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:

Description Vineet Reynolds 2013-06-27 09:57:51 UTC
Description of problem:
When deleting entities like Performances from the Administration site, the entities are not deleted at all and reappear after deletion or failures are encountered during deletion.

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


How reproducible: Always


Steps to Reproduce:
1. Click the Performance entry in the side-bar.
2. Select an existing Performance in the list of Performances to view the performance.
3. Click the Edit button to modify the Performance.
4. Click the Delete button to delete the Performance.

Actual results:

An error message stating that a constraint violation error has occurred, is displayed upon deletion of the Performance.

If Forge 1.3.1 or earlier was used to generate the Administration site, the deleted performance will reappear in the list of performances.

Expected results:

The Performance should be deleted.

Additional info:

This was fixed upstream in the TicketMonster Git patch (JDF-389). The issue involving re-appearing of deleted entities was fixed in FORGE-916 (released in Forge 1.3.2).

Comment 2 Vineet Reynolds 2013-07-17 21:46:15 UTC
Migrated to JIRA

Comment 3 JBoss JIRA Server 2013-07-29 15:43:51 UTC
Vineet Reynolds <vineet.reynolds> made a comment on jira WFK2-59

This has a possibility of being no longer relevant, if we incorporate HTML5 scaffolding in WFK2-73 since this is a bug in the existing Faces scaffolding.