Fixed bugs with transaction scope

Fixed bugs with transaction scope and missing return statements in data
access layefr