Error adding use case after deleting a story
Status: Alpha
Brought to you by:
rreganjr
I created a story then rewrote it (with the same name) as a use case. Now I get the following error when I try to add further use cases, which I assume is because I deleted the original story:
Could not save: javax.persistence.EntityNotFoundException: Unable to find edu.harvard.fas.rregan.requel.project.impl.StoryImpl with id 1
I was easily able to reproduce the problem. It looks like the reference between the actor and story wasn't deleted with the story was deleted, now any time the actor is loaded from the database it causes an error because the actor refers to the deleted story.
if you have access to the database you can delete the entry in the actor_actorcontainers table where the actorcontainer_type = edu.harvard.fas.rregan.requel.project.impl.StoryImpl and the actorcontainer_id = 1
I updated DeleteStoryCommandImpl to RemoveActorFromActorContainerCommand and RemoveGoalFromGoalContainerCommand before deleting the story so that actors and goals don't hold an invalid reference to the story.
This appears to solve the problem I reproduced.
I updated the 1.0c requel.war file with the fix.