Add some tests to try and find database transaction bug. Tests find something, not yet fixed!
Trying to find a bug in DB handling