Debugging database access