utility function to get stored object
HACK. Do not clear objects from database, as we clear all objects anyway. Reason: The clearing fails on complex cascades.