Fix cid handling during rollback operation

Ensure a consistan cid handling accross different database backends