func to get dbmap from a transaction