Add tests for broken transaction logic when changing PDO
Fix broken transaction logic when PDO changes