This is probably caused by the ID's in the link table. You could try and remove the data from the AB-link table and then delete the B entity. The removal of the data should then be done in the database of course. I don't however know this would/could cause side effects.
Just to be save (and you can never be safe enough when it comes to database conversions)I would create a temporary entity with the same attributes as A, and move all objects to that entity. Than delete object B, this will clear object A. Finally, move all objects from the temporary entity to object A and delete the temporary entity.