This happens in Wombat as well.
Problem: The refcount gets out of sync.
To duplicate the problem:
1. Assign and attribute template to a product attribute, the refcount gets incrimented as expected.
2. Change the assignment to a different attribute template, the refcount for the first is not decremented and the refcount for the second is not incrimented.
Result:
Unfortunately, it makes it possible to delete an attribute template that IS assigned to a product, leaving the product attributes in an inconsistant state. It also makes it impossible to delete an attribute that IS NOT used.
Work-a-round:
In Product Attributes, delete the template assignment before assigning a new one. As for the database, s0n_Attribues.refcount has to be corrected manually.
I reported this in Bugzilla today.
Problem: The refcount gets out of sync.
To duplicate the problem:
1. Assign and attribute template to a product attribute, the refcount gets incrimented as expected.
2. Change the assignment to a different attribute template, the refcount for the first is not decremented and the refcount for the second is not incrimented.
Result:
Unfortunately, it makes it possible to delete an attribute template that IS assigned to a product, leaving the product attributes in an inconsistant state. It also makes it impossible to delete an attribute that IS NOT used.
Work-a-round:
In Product Attributes, delete the template assignment before assigning a new one. As for the database, s0n_Attribues.refcount has to be corrected manually.
I reported this in Bugzilla today.