cancel
Showing results for 
Search instead for 
Did you mean: 

Cleaning of database after update

Former Member
0 Kudos

I have two extensions extA and extB.

I have an item item1 defined in both extA and extB.

extB defines a dynamic attribute on item1 and the associated bean.

I want to remove extB from my project because it represents a feature I don't need anymore.

Then I got errors

 cannot find spring bean [xxxx] configured for dynamic attribute [item1.dynamicAtt] from extension [extB] 
 Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxxxHandler' available

To fix this I need to clean myself attribute descriptors using :

 DELETE FROM attributedescriptors WHERE (p_extensionname ='extB')

For me this action should be done by the update process. I don't understand why this link is not cleaned? Basically this issue make the concept of extensions useless since you can't remove them easily...

Accepted Solutions (0)

Answers (2)

Answers (2)

agrabovskis
Participant
0 Kudos

The update process does not remove:

  • item instances

  • attributes

If the first problem can be easily solved by running the type system cleanup, then the latter one is not that straight-forward. Given your example, I agree, that removal of attribute descriptors would be the expected behaviour without removing the actual columns (that should be done manually by DBA taking into account table size, removal strategy to reduce locking issues, data to be deleted, and other aspects).

Btw, this is one of the reasons why I consider dynamic attributes to be potentially harmful (and thereby undesired) - removing such an attribute might break the application after system update. To mitigate that you have to create projectdata or essentialdata script that removes the attribute descriptor bulk belonging to the removed extension.

Former Member
0 Kudos

Indeed there is no pb on item level. The issue is that attributedescriptors can't be removed with impex since they have no item representation. It's a bean persisted on DB. So you can't include that in projectdata/essentialdata afaik. But you're right dynamic attribute is potentially a source of problem.

crescenzorega
Active Participant
0 Kudos
Former Member
0 Kudos

I don't care that the item representation is still in the DB. It's safer this way because it avoid data loss. The issue is with the attributedescriptor and attributedescriptors are not items...