Skip to Content
author's profile photo Former Member
Former Member

Cleaning of database after update

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...

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Feb 06, 2018 at 08:52 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • Posted on Feb 06, 2018 at 04:41 PM
    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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...

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.