I'll start a new thread on this. The thread on CAS-1255 got me started on this,
and my worries are somewhat confirmed. Or am I missing something? The number of
layers of indirection in this part of the code make the logic somewhat
difficult to follow so that may very well be the case.
This is the JpaTicketRegistry implementation:
@Transactional(readOnly = false)
public boolean deleteTicket(final String ticketId) {
final Ticket ticket = getRawTicket(ticketId);
if (ticket == null) {
return false;
}
if (ticket instanceof ServiceTicket) {
removeTicket(ticket);
log.debug("Deleted ticket [{}] from the registry.", ticket);
return true;
}
deleteTicketAndChildren(ticket);
log.debug("Deleted ticket [{}] and its children from the registry.",
ticket);
return true;
}
This is the contract in TicketRegistry.
/**
* Remove a specific ticket from the registry.
*
* @param ticketId The id of the ticket to delete.
* @return true if the ticket was removed and false if the ticket did not
* exist.
*/
boolean deleteTicket(String ticketId);
It says absolutely nothing about deleting related tickets. I would rather claim
that is says to specifically delete the ticket with the given id, not any other
ticket with some other id, and that the current JpaTicketRegistry
implementation is broken given the existing contract. So, what's the expected
behavior of a proper ticket registry here? This does have consequences for how
e.g. PGTs behave depending on selected ticket storage and this makes me
uncomfortable.
I believe, e.g., MemcacheTicketRegistry does not behave like this.
Best regards,
/Fredrik
--
You are currently subscribed to [email protected] as:
[email protected]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-dev