Fix for intermittent bug in findorcreate with transaction