Bug 978925 - Ticket Monster: generated Administration section does not perform deletion of Performances correctly
Summary: Ticket Monster: generated Administration section does not perform deletion of...
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: JBoss Enterprise WFK Platform 2
Classification: Retired
Component: TicketMonster
Version: 2.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 2.4.0
Assignee: Pete Muir
QA Contact: Tomas Repel
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-27 09:57 UTC by Vineet Reynolds
Modified: 2013-07-29 15:43 UTC (History)
3 users (show)

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.
Clone Of:
Environment:
Last Closed: 2013-07-17 21:42:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JDF-389 0 Major Resolved Revise the Git patches of TicketMonster for Forge 1.3.2 2013-11-19 09:45:01 UTC
Red Hat Issue Tracker WFK2-59 0 Major Verified Ticket Monster: generated Administration section does not perform deletion of Performances correctly 2013-11-19 09:45:02 UTC

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.


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