Forum OpenACS Development: Response to Multiple package instances - correct behavior on instance deletion?

I agree that instance deletion is a feature that is not "well specified", or at best poorly documented in the design of ACS. While the design specs require a drop script to delete an entire package, there is no corresponding mechanism that specifies what happens to the data belonging to an instance of a package once the instance is deleted.

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.