Changed learning design activities and transition collections to use all-delete-orphan cascade management. This will ensure that the secondary records are created and removed as required. This required fixing code that trigger cascade problems and also highlighted some session problems with the learner cache created by Jacky.
Implementation getLearningLibraryByTitle was wrong and the method is not used so the whole method was removed. Implementation of getLearningLibraries was returning all libraries in the database. Changed to only return the active libraries (ie the libraries that have been successfully installed).