add debug output related to app enablement

This PR is the result of half a day of investigating the app enable code when a debugger was not available and oc5 was running on an oracle DB.

@karlitschek @DeepDiver1975 please review. Not necessary for OC6 because doctrine throws exceptions.