Forum OpenACS Development: Response to Multiple package instances - correct behavior on instance deletion?
I think we should also require that every non-singleton package must specify what to do when an instance is deleted. An explicit "on delete cascade", or a trigger in the datamodel, perhaps, that gets activated when package_id (or whatever hook to the APM is) is deleted? "On delete cascade" to take care of the cleanup is not always feasible, esp. for packages that use a service. In the case of File Storage, the data resides mostly in CR, which knows nothing about the implementation (singleton or not) of the package that uses it. If CR does not know anything about instances, it cannot "on delete cascade" based on instances. Thus, stuff on File Storage will be orphaned when a package instance is deleted, as Andrew illustrates (unless a trigger is added). It'll be interesting to look at calendar (which uses acs-events) to see how it behaves when an instance is deleted, and whether it also orphans stuff on acs-events tables.