wrap data source use/unuse in transaction so we are sure of the unuse

extracted from #481 
And yes, I do care about documentation :)