add withTransaction function to dbapi